use of com.google.security.zynamics.binnavi.debug.models.breakpoints.Breakpoint in project binnavi by google.
the class CBreakpointModuleSynchronizer method processModuleBreakpoints.
private static void processModuleBreakpoints(final IDebugger debugger, final MemoryModule module, final BreakpointType breakPointType, final IModuleBreakpointEnumerator callback) {
final BreakpointManager manager = debugger.getBreakpointManager();
final Set<BreakpointAddress> breakpointAddresses = new HashSet<BreakpointAddress>();
for (final Breakpoint breakpoint : manager.getBreakpointsByModule(breakPointType, module)) {
if ((manager.getBreakpointStatus(breakpoint.getAddress(), breakpoint.getType()) != BreakpointStatus.BREAKPOINT_ENABLED) && (manager.getBreakpointStatus(breakpoint.getAddress(), breakpoint.getType()) != BreakpointStatus.BREAKPOINT_DISABLED) && isWithinModule(debugger, module, breakpoint)) {
breakpointAddresses.add(breakpoint.getAddress());
}
}
callback.handleAddress(manager, breakpointAddresses);
}
use of com.google.security.zynamics.binnavi.debug.models.breakpoints.Breakpoint in project binnavi by google.
the class CBreakpointRemoveFunctions method removeAll.
/**
* Removes all breakpoints of a given breakpoint manager.
*
* @param manager The breakpoints manager whose breakpoints are removed.
*/
private static void removeAll(final BreakpointManager manager) {
final Set<BreakpointAddress> addresses = new HashSet<BreakpointAddress>();
for (final Breakpoint breakpoint : manager.getBreakpoints(BreakpointType.REGULAR)) {
addresses.add(breakpoint.getAddress());
}
CGraphDebugger.removeBreakpoints(addresses, manager);
}
use of com.google.security.zynamics.binnavi.debug.models.breakpoints.Breakpoint in project binnavi by google.
the class CBreakpointTable method showPopupMenu.
/**
* Displays the popup menu at the location specified by the click event.
*
* @param event The click event.
*/
private void showPopupMenu(final MouseEvent event) {
final int row = rowAtPoint(event.getPoint());
final int column = columnAtPoint(event.getPoint());
int[] rows = getSelectedRows();
if ((rows.length == 0) || (rows.length == 1)) {
changeSelection(row, column, false, false);
rows = getSelectedRows();
}
final JPopupMenu menu = new JPopupMenu();
menu.add(new JMenuItem(CActionProxy.proxy(new CDeleteAction(m_debuggerProvider, rows))));
if (CBreakpointFunctions.allDisabled(m_debuggerProvider, rows)) {
menu.add(new JMenuItem(CActionProxy.proxy(new CEnableAction(m_debuggerProvider, rows))));
} else if (CBreakpointFunctions.allNotDisabled(m_debuggerProvider, rows)) {
menu.add(new JMenuItem(CActionProxy.proxy(new CDisableAction(m_debuggerProvider, rows))));
}
if (rows.length == 1) {
menu.addSeparator();
final Pair<IDebugger, Integer> breakpoint = CBreakpointTableHelpers.findBreakpoint(m_debuggerProvider, rows[0]);
final BreakpointManager manager = breakpoint.first().getBreakpointManager();
final int breakpointIndex = breakpoint.second();
final BreakpointAddress address = manager.getBreakpoint(BreakpointType.REGULAR, breakpointIndex).getAddress();
menu.add(new JMenuItem(CActionProxy.proxy(new CZoomBreakpointAction(SwingUtilities.windowForComponent(this), m_graph, m_viewContainer, address))));
}
menu.show(event.getComponent(), event.getX(), event.getY());
}
use of com.google.security.zynamics.binnavi.debug.models.breakpoints.Breakpoint 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);
}
}
use of com.google.security.zynamics.binnavi.debug.models.breakpoints.Breakpoint 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);
}
}
Aggregations