Example #1
0
  protected void toggleBreakpoint(Address address) {

    Breakpoint existing = emulator.getBreakPoint(address);
    if (existing == null) {
      emulator.addBreakpoint(new Breakpoint(address));
    } else {
      emulator.deleteBreakpoint(existing);
    }
  }
Example #2
0
  private String createLinePrefix(Address pc, Address realAddress, DisassembledLine line) {
    /*
     * The prefix may contain a flag indicating that
     * a breakpoint is present on this line as well
     * as a caret for the current program counter (PC) position.
     *
     * Example:
     *
     * [B] >> 0000: SET a,1
     */

    final Breakpoint breakpoint = emulator.getBreakPoint(realAddress);
    String prefix1 = breakpoint != null ? breakpoint.isEnabled() ? "[B] " : "[_] " : "    ";
    String prefix2 = realAddress.equals(pc) ? ">> " : "   ";
    return prefix1 + prefix2;
  }