Esempio n. 1
0
  /**
   * Formats the LOCATION synthetic property from the existing fields
   *
   * @return The location string
   */
  private String formatLocation() {

    // Unlikely default location
    String location = fBreakpoint.getAddress();

    // Get the relevant parameters
    String fileName = fBreakpoint.getFile();
    Integer lineNumber = fBreakpoint.getLine();
    String function = fBreakpoint.getFunction();

    if (!fileName.equals("")) { // $NON-NLS-1$
      if (lineNumber != -1) {
        location = fileName + ":" + lineNumber; // $NON-NLS-1$
      } else {
        location = fileName + ":" + function; // $NON-NLS-1$
      }
    }

    return location;
  }
Esempio n. 2
0
 public int getReference() {
   return fBreakpoint.getNumber();
 }
Esempio n. 3
0
 /** @since 4.0 */
 public boolean isPending() {
   return fBreakpoint.isPending();
 }
Esempio n. 4
0
 public boolean isWriteWatchpoint() {
   return fBreakpoint.isWriteWatchpoint();
 }
Esempio n. 5
0
 /** @since 3.0 */
 public void setCommands(String commands) {
   fBreakpoint.setCommands(commands);
   fProperties.put(MIBreakpoints.COMMANDS, commands);
 }
Esempio n. 6
0
 public void setEnabled(boolean isEnabled) {
   fBreakpoint.setEnabled(isEnabled);
   fProperties.put(MIBreakpoints.IS_ENABLED, isEnabled);
 }
Esempio n. 7
0
 public void setCondition(String condition) {
   fBreakpoint.setCondition(condition);
   fProperties.put(MIBreakpoints.CONDITION, condition);
 }
Esempio n. 8
0
 public String getFullName() {
   return fBreakpoint.getFullName();
 }
Esempio n. 9
0
 public int getIgnoreCount() {
   return fBreakpoint.getIgnoreCount();
 }
Esempio n. 10
0
 public String getFunctionName() {
   return fBreakpoint.getFunction();
 }
Esempio n. 11
0
 public String getFileName() {
   return fBreakpoint.getFile();
 }
Esempio n. 12
0
 public String getExpression() {
   return fBreakpoint.getExpression();
 }
Esempio n. 13
0
 public String getCondition() {
   return fBreakpoint.getCondition();
 }
Esempio n. 14
0
 public IAddress[] getAddresses() {
   IAddress[] addresses = new IAddress[1];
   addresses[0] = new Addr64(fBreakpoint.getAddress());
   return addresses;
 }
Esempio n. 15
0
 public boolean isHardware() {
   return fBreakpoint.isHardware();
 }
Esempio n. 16
0
 public int getHits() {
   return fBreakpoint.getTimes();
 }
Esempio n. 17
0
 public int getLineNumber() {
   return fBreakpoint.getLine();
 }
Esempio n. 18
0
 public String getType() {
   return fBreakpoint.getType();
 }
Esempio n. 19
0
 public boolean isEnabled() {
   return fBreakpoint.isEnabled();
 }
Esempio n. 20
0
 public void setIgnoreCount(int ignoreCount) {
   fBreakpoint.setIgnoreCount(ignoreCount);
   fProperties.put(MIBreakpoints.IGNORE_COUNT, ignoreCount);
 }
Esempio n. 21
0
 /** @since 3.0 */
 public int getPassCount() {
   return fBreakpoint.getPassCount();
 }
Esempio n. 22
0
 /** @since 3.0 */
 public void setPassCount(int count) {
   fBreakpoint.setPassCount(count);
   fProperties.put(MIBreakpoints.PASS_COUNT, count);
 }
Esempio n. 23
0
 /** @since 3.0 */
 public String getCommands() {
   return fBreakpoint.getCommands();
 }
Esempio n. 24
0
 public boolean isReadWatchpoint() {
   return fBreakpoint.isReadWatchpoint();
 }
Esempio n. 25
0
 public int getNumber() {
   return fBreakpoint.getNumber();
 }
Esempio n. 26
0
 public boolean isAccessWatchpoint() {
   return fBreakpoint.isAccessWatchpoint();
 }
Esempio n. 27
0
 public String getThreadId() {
   return fBreakpoint.getThreadId();
 }
Esempio n. 28
0
  /**
   * Constructs a DsfMIBreakpoint from a back-end object
   *
   * @param dsfMIBreakpoint back-end breakpoint
   */
  public MIBreakpointDMData(MIBreakpoint dsfMIBreakpoint) {

    // No support for catchpoints yet
    fBreakpoint = dsfMIBreakpoint;
    if (dsfMIBreakpoint.isTracepoint()) {
      fNature = MIBreakpointNature.TRACEPOINT;
    } else if (dsfMIBreakpoint.isWatchpoint()) {
      fNature = MIBreakpointNature.WATCHPOINT;
    } else if (dsfMIBreakpoint.isCatchpoint()) {
      fNature = MIBreakpointNature.CATCHPOINT;
    } else {
      fNature = MIBreakpointNature.BREAKPOINT;
    }

    fProperties = new HashMap<String, Object>();
    switch (fNature) {
      case BREAKPOINT:
        {
          // Note that this may in fact be a catchpoint. See comment below in
          // CATCHPOINT case

          // Generic breakpoint attributes
          fProperties.put(MIBreakpoints.BREAKPOINT_TYPE, MIBreakpoints.BREAKPOINT);
          fProperties.put(MIBreakpoints.FILE_NAME, dsfMIBreakpoint.getFile());
          fProperties.put(MIBreakpoints.LINE_NUMBER, dsfMIBreakpoint.getLine());
          fProperties.put(MIBreakpoints.FUNCTION, dsfMIBreakpoint.getFunction());
          fProperties.put(MIBreakpoints.ADDRESS, dsfMIBreakpoint.getAddress());
          fProperties.put(MIBreakpoints.CONDITION, dsfMIBreakpoint.getCondition());
          fProperties.put(MIBreakpoints.IGNORE_COUNT, dsfMIBreakpoint.getIgnoreCount());
          fProperties.put(MIBreakpoints.IS_ENABLED, new Boolean(dsfMIBreakpoint.isEnabled()));
          fProperties.put(MIBreakpoints.COMMANDS, dsfMIBreakpoint.getCommands());

          // MI-specific breakpoint attributes
          fProperties.put(NUMBER, dsfMIBreakpoint.getNumber());
          fProperties.put(TYPE, dsfMIBreakpoint.getType());
          fProperties.put(THREAD_ID, dsfMIBreakpoint.getThreadId());
          fProperties.put(FULL_NAME, dsfMIBreakpoint.getFullName());
          fProperties.put(HITS, dsfMIBreakpoint.getTimes());
          fProperties.put(IS_TEMPORARY, new Boolean(dsfMIBreakpoint.isTemporary()));
          fProperties.put(IS_HARDWARE, new Boolean(dsfMIBreakpoint.isHardware()));
          fProperties.put(LOCATION, formatLocation());
          break;
        }

      case WATCHPOINT:
        {
          // Generic breakpoint attributes
          fProperties.put(MIBreakpoints.BREAKPOINT_TYPE, MIBreakpoints.WATCHPOINT);
          fProperties.put(MIBreakpoints.EXPRESSION, dsfMIBreakpoint.getExpression());
          fProperties.put(
              MIBreakpoints.READ,
              dsfMIBreakpoint.isAccessWatchpoint() || dsfMIBreakpoint.isReadWatchpoint());
          fProperties.put(
              MIBreakpoints.WRITE,
              dsfMIBreakpoint.isAccessWatchpoint() || dsfMIBreakpoint.isWriteWatchpoint());

          // MI-specific breakpoint attributes
          fProperties.put(NUMBER, dsfMIBreakpoint.getNumber());
          break;
        }

      case TRACEPOINT:
        {
          // Generic breakpoint attributes
          fProperties.put(MIBreakpoints.BREAKPOINT_TYPE, MIBreakpoints.TRACEPOINT);
          fProperties.put(MIBreakpoints.FILE_NAME, dsfMIBreakpoint.getFile());
          fProperties.put(MIBreakpoints.LINE_NUMBER, dsfMIBreakpoint.getLine());
          fProperties.put(MIBreakpoints.FUNCTION, dsfMIBreakpoint.getFunction());
          fProperties.put(MIBreakpoints.ADDRESS, dsfMIBreakpoint.getAddress());
          fProperties.put(MIBreakpoints.CONDITION, dsfMIBreakpoint.getCondition());
          fProperties.put(MIBreakpoints.PASS_COUNT, dsfMIBreakpoint.getPassCount());
          fProperties.put(MIBreakpoints.IS_ENABLED, new Boolean(dsfMIBreakpoint.isEnabled()));
          fProperties.put(MIBreakpoints.COMMANDS, dsfMIBreakpoint.getCommands());

          // MI-specific breakpoint attributes
          fProperties.put(NUMBER, dsfMIBreakpoint.getNumber());
          fProperties.put(TYPE, dsfMIBreakpoint.getType());
          fProperties.put(THREAD_ID, dsfMIBreakpoint.getThreadId());
          fProperties.put(FULL_NAME, dsfMIBreakpoint.getFullName());
          fProperties.put(HITS, dsfMIBreakpoint.getTimes());
          fProperties.put(IS_TEMPORARY, new Boolean(dsfMIBreakpoint.isTemporary()));
          fProperties.put(IS_HARDWARE, new Boolean(dsfMIBreakpoint.isHardware()));
          fProperties.put(LOCATION, formatLocation());
          break;
        }

      case CATCHPOINT:
        {
          // Because gdb doesn't support catchpoints in mi, we end up using
          // CLI to set the catchpoint. The sort of MIBreakpoint we create
          // at that time is minimal as the only information we get back from
          // gdb is the breakpoint number and type of the catchpoint we just
          // set. See MIBreakpoint(String)
          //
          // The only type of MIBreakpoint that will be of this CATCHPOINT type
          // is the instance we create from the response of the CLI command we
          // use to set the catchpoint. If we later query gdb for the breakpoint
          // list, we'll unfortunately end up creating an MIBreakpoint of type
          // BREAKPOINT. Maybe one day gdb will treats catchpoints like first
          // class citizens and this messy situation will go away.

          fProperties.put(MIBreakpoints.BREAKPOINT_TYPE, MIBreakpoints.CATCHPOINT);
          fProperties.put(MIBreakpoints.CATCHPOINT_TYPE, dsfMIBreakpoint.getCatchpointType());
          fProperties.put(NUMBER, dsfMIBreakpoint.getNumber());
          break;
        }

        // Not reachable
      default:
        {
          fProperties.put(MIBreakpoints.BREAKPOINT_TYPE, null);
          break;
        }
    }
  }
Esempio n. 29
0
 public boolean isTemporary() {
   return fBreakpoint.isTemporary();
 }