use of com.google.security.zynamics.binnavi.debug.models.breakpoints.BreakpointManager 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);
}
use of com.google.security.zynamics.binnavi.debug.models.breakpoints.BreakpointManager 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();
}
use of com.google.security.zynamics.binnavi.debug.models.breakpoints.BreakpointManager 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);
}
}
use of com.google.security.zynamics.binnavi.debug.models.breakpoints.BreakpointManager 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);
}
}
use of com.google.security.zynamics.binnavi.debug.models.breakpoints.BreakpointManager 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);
}
}
Aggregations