Search in sources :

Example 21 with IDebugger

use of com.google.security.zynamics.binnavi.debug.debugger.interfaces.IDebugger in project binnavi by google.

the class CBreakpointTableModel method getBreakpointStatus.

/**
 * Determines the breakpoint status of the breakpoint shown in a given row.
 *
 * @param row The row where the breakpoint is shown.
 *
 * @return The breakpoint status of the breakpoint shown in the given row.
 */
private BreakpointStatus getBreakpointStatus(final int row) {
    final Pair<IDebugger, Integer> breakpoint = CBreakpointTableHelpers.findBreakpoint(m_debuggerProvider, row);
    final BreakpointManager manager = breakpoint.first().getBreakpointManager();
    final int breakpointIndex = breakpoint.second();
    return manager.getBreakpointStatus(BreakpointType.REGULAR, breakpointIndex);
}
Also used : BreakpointManager(com.google.security.zynamics.binnavi.debug.models.breakpoints.BreakpointManager) IDebugger(com.google.security.zynamics.binnavi.debug.debugger.interfaces.IDebugger)

Example 22 with IDebugger

use of com.google.security.zynamics.binnavi.debug.debugger.interfaces.IDebugger in project binnavi by google.

the class CBreakpointTableModel method getBreakpointDescription.

/**
 * Determines the description of the breakpoint shown in a given row.
 *
 * @param row The row where the breakpoint is shown.
 *
 * @return The description of the breakpoint shown in the given row.
 */
private String getBreakpointDescription(final int row) {
    final Pair<IDebugger, Integer> breakpoint = CBreakpointTableHelpers.findBreakpoint(m_debuggerProvider, row);
    final BreakpointManager manager = breakpoint.first().getBreakpointManager();
    final int breakpointIndex = breakpoint.second();
    return manager.getBreakpoint(BreakpointType.REGULAR, breakpointIndex).getDescription();
}
Also used : BreakpointManager(com.google.security.zynamics.binnavi.debug.models.breakpoints.BreakpointManager) IDebugger(com.google.security.zynamics.binnavi.debug.debugger.interfaces.IDebugger)

Example 23 with IDebugger

use of com.google.security.zynamics.binnavi.debug.debugger.interfaces.IDebugger in project binnavi by google.

the class CBreakpointRemoveFunctions method disableBreakpoints.

/**
 * Disables the breakpoints identified by the rows argument.
 *
 * @param debuggerProvider Provides the debuggers where breakpoints can be set.
 * @param rows Rows that identify the breakpoints.
 */
public static void disableBreakpoints(final BackEndDebuggerProvider debuggerProvider, final int[] rows) {
    Preconditions.checkNotNull(debuggerProvider, "IE01919: Debugger provider argument can not be null");
    Preconditions.checkNotNull(rows, "IE02254: Rows argument can't be null");
    for (final int row : rows) {
        final Pair<IDebugger, Integer> breakpoint = CBreakpointTableHelpers.findBreakpoint(debuggerProvider, row);
        final BreakpointManager manager = breakpoint.first().getBreakpointManager();
        final int breakpointIndex = breakpoint.second();
        manager.setBreakpointStatus(BreakpointType.REGULAR, BreakpointStatus.BREAKPOINT_DISABLED, breakpointIndex);
    }
}
Also used : BreakpointManager(com.google.security.zynamics.binnavi.debug.models.breakpoints.BreakpointManager) Breakpoint(com.google.security.zynamics.binnavi.debug.models.breakpoints.Breakpoint) IDebugger(com.google.security.zynamics.binnavi.debug.debugger.interfaces.IDebugger)

Example 24 with IDebugger

use of com.google.security.zynamics.binnavi.debug.debugger.interfaces.IDebugger in project binnavi by google.

the class CBreakpointRemoveFunctions method disableAllView.

/**
 * Disables all breakpoints which are part of a view.
 *
 * @param debuggerProvider Provides the debuggers where breakpoints can be set.
 * @param view The view to consider when disabling the breakpoints.
 */
public static void disableAllView(final BackEndDebuggerProvider debuggerProvider, final INaviView view) {
    Preconditions.checkNotNull(debuggerProvider, "IE01889: Debugger provider argument can not be null");
    Preconditions.checkNotNull(view, "IE02009: View argument can't be null");
    for (final IDebugger debugger : debuggerProvider) {
        final BreakpointManager manager = debugger.getBreakpointManager();
        final Set<BreakpointAddress> addressesToDisable = new HashSet<BreakpointAddress>();
        for (int i = 0; i < manager.getNumberOfBreakpoints(BreakpointType.REGULAR); i++) {
            final BreakpointAddress address = manager.getBreakpoint(BreakpointType.REGULAR, i).getAddress();
            if (CViewHelpers.containsAddress(view, address.getAddress())) {
                addressesToDisable.add(address);
            }
        }
        manager.setBreakpointStatus(addressesToDisable, BreakpointType.REGULAR, BreakpointStatus.BREAKPOINT_DISABLED);
    }
}
Also used : BreakpointAddress(com.google.security.zynamics.binnavi.debug.models.breakpoints.BreakpointAddress) BreakpointManager(com.google.security.zynamics.binnavi.debug.models.breakpoints.BreakpointManager) IDebugger(com.google.security.zynamics.binnavi.debug.debugger.interfaces.IDebugger) Breakpoint(com.google.security.zynamics.binnavi.debug.models.breakpoints.Breakpoint) HashSet(java.util.HashSet)

Example 25 with IDebugger

use of com.google.security.zynamics.binnavi.debug.debugger.interfaces.IDebugger in project binnavi by google.

the class CBreakpointRemoveFunctions method deleteBreakpoints.

/**
 * Deletes the breakpoints specified by the rows argument.
 *
 * @param debuggerProvider Provides the debuggers where breakpoints can be set.
 * @param rows Rows that identify the breakpoints.
 */
public static void deleteBreakpoints(final BackEndDebuggerProvider debuggerProvider, final int[] rows) {
    Preconditions.checkNotNull(debuggerProvider, "IE01886: Debugger provider argument can not be null");
    Preconditions.checkNotNull(rows, "IE02253: Rows argument can't be null");
    final ArrayList<Pair<IDebugger, BreakpointAddress>> addresses = new ArrayList<Pair<IDebugger, BreakpointAddress>>();
    for (final int row : rows) {
        final Pair<IDebugger, Integer> breakpoint = CBreakpointTableHelpers.findBreakpoint(debuggerProvider, row);
        final BreakpointManager manager = breakpoint.first().getBreakpointManager();
        final int breakpointIndex = breakpoint.second();
        addresses.add(new Pair<IDebugger, BreakpointAddress>(breakpoint.first(), manager.getBreakpoint(BreakpointType.REGULAR, breakpointIndex).getAddress()));
    }
    for (final Pair<IDebugger, BreakpointAddress> p : addresses) {
        final BreakpointManager manager = p.first().getBreakpointManager();
        final BreakpointAddress address = p.second();
        manager.setBreakpointStatus(Sets.newHashSet(address), BreakpointType.REGULAR, BreakpointStatus.BREAKPOINT_DELETING);
    }
}
Also used : ArrayList(java.util.ArrayList) BreakpointAddress(com.google.security.zynamics.binnavi.debug.models.breakpoints.BreakpointAddress) BreakpointManager(com.google.security.zynamics.binnavi.debug.models.breakpoints.BreakpointManager) IDebugger(com.google.security.zynamics.binnavi.debug.debugger.interfaces.IDebugger) Breakpoint(com.google.security.zynamics.binnavi.debug.models.breakpoints.Breakpoint) Pair(com.google.security.zynamics.zylib.general.Pair)

Aggregations

IDebugger (com.google.security.zynamics.binnavi.debug.debugger.interfaces.IDebugger)62 BreakpointManager (com.google.security.zynamics.binnavi.debug.models.breakpoints.BreakpointManager)16 TargetProcessThread (com.google.security.zynamics.binnavi.debug.models.processmanager.TargetProcessThread)16 MockDebugger (com.google.security.zynamics.binnavi.Debug.Debugger.MockDebugger)6 ModuleTargetSettings (com.google.security.zynamics.binnavi.debug.debugger.ModuleTargetSettings)6 Breakpoint (com.google.security.zynamics.binnavi.debug.models.breakpoints.Breakpoint)6 BreakpointAddress (com.google.security.zynamics.binnavi.debug.models.breakpoints.BreakpointAddress)6 CAddress (com.google.security.zynamics.zylib.disassembly.CAddress)6 Test (org.junit.Test)6 MemorySection (com.google.security.zynamics.binnavi.debug.models.processmanager.MemorySection)5 INaviModule (com.google.security.zynamics.binnavi.disassembly.INaviModule)5 UnrelocatedAddress (com.google.security.zynamics.binnavi.disassembly.UnrelocatedAddress)5 CDebugPerspectiveModel (com.google.security.zynamics.binnavi.Gui.GraphWindows.Panels.CDebugPerspectiveModel)4 INaviFunction (com.google.security.zynamics.binnavi.disassembly.INaviFunction)4 INaviInstruction (com.google.security.zynamics.binnavi.disassembly.INaviInstruction)4 BookmarkManager (com.google.security.zynamics.binnavi.models.Bookmarks.memory.BookmarkManager)4 IAddress (com.google.security.zynamics.zylib.disassembly.IAddress)4 Pair (com.google.security.zynamics.zylib.general.Pair)4 ArrayList (java.util.ArrayList)4 IGraphModel (com.google.security.zynamics.binnavi.Gui.GraphWindows.IGraphModel)3