Search in sources :

Example 1 with BreakpointManager

use of com.google.security.zynamics.binnavi.API.debug.BreakpointManager in project binnavi by google.

the class CallResolver method removeBreakpoint.

/**
   * Removes a breakpoint from an indirect call.
   *
   * @param indirectCall The indirect call from which the breakpoint is removed.
   */
private void removeBreakpoint(final IndirectCall indirectCall) {
    final Module module = indirectCall.getModule();
    final Address address = indirectCall.getAddress();
    final BreakpointManager breakpointManager = debugger.getBreakpointManager();
    if (breakpointManager.hasBreakpoint(module, address)) {
        debugger.getBreakpointManager().removeBreakpoint(indirectCall.getModule(), indirectCall.getAddress());
    }
}
Also used : Address(com.google.security.zynamics.binnavi.API.disassembly.Address) MemoryModule(com.google.security.zynamics.binnavi.API.debug.MemoryModule) Module(com.google.security.zynamics.binnavi.API.disassembly.Module) BreakpointManager(com.google.security.zynamics.binnavi.API.debug.BreakpointManager)

Example 2 with BreakpointManager

use of com.google.security.zynamics.binnavi.API.debug.BreakpointManager in project binnavi by google.

the class VisualCoverage method updatePreviousNode.

/**
   * Updates the color of the previously hit node depending on its hit count.
   */
private void updatePreviousNode() {
    if ((previousNodeAddress == null) || !myBreakpoints.contains(previousNodeAddress)) {
        return;
    }
    final ViewNode node = nodeMap.get(previousNodeAddress);
    final int count = breakpointCounter.get(previousNodeAddress);
    if (count < 5) {
        node.setColor(COLOR_FEW_HITS);
    } else if (count < 10) {
        node.setColor(COLOR_SEVERAL_HITS);
    } else {
        node.setColor(COLOR_MANY_HITS);
        // After a breakpoint was hit 10 times we remove it so we do not
        // hit it again.
        final BreakpointManager breakpointManager = debugger.getBreakpointManager();
        if (breakpointManager.hasBreakpoint(null, previousNodeAddress)) {
            breakpointManager.removeBreakpoint(null, previousNodeAddress);
            myBreakpoints.remove(previousNodeAddress);
        }
    }
    try {
        java.lang.Thread.sleep(100);
    } catch (final InterruptedException e) {
        // restore the interrupted status of the thread.
        // http://www.ibm.com/developerworks/java/library/j-jtp05236/index.html
        java.lang.Thread.currentThread().interrupt();
    }
}
Also used : ViewNode(com.google.security.zynamics.binnavi.API.disassembly.ViewNode) BreakpointManager(com.google.security.zynamics.binnavi.API.debug.BreakpointManager)

Aggregations

BreakpointManager (com.google.security.zynamics.binnavi.API.debug.BreakpointManager)2 MemoryModule (com.google.security.zynamics.binnavi.API.debug.MemoryModule)1 Address (com.google.security.zynamics.binnavi.API.disassembly.Address)1 Module (com.google.security.zynamics.binnavi.API.disassembly.Module)1 ViewNode (com.google.security.zynamics.binnavi.API.disassembly.ViewNode)1