use of com.google.security.zynamics.binnavi.debug.models.breakpoints.BreakpointAddress in project binnavi by google.
the class CEventTableModel method getValueAt.
@Override
public Object getValueAt(final int row, final int col) {
final ITraceEvent debugEvent = getEvents().get(row);
final BreakpointAddress address = debugEvent.getOffset();
switch(col) {
case INDEX_COLUMN:
return row + 1;
case THREAD_COLUMN:
return Long.valueOf(debugEvent.getThreadId());
case MODULE_COLUMN:
return address.getModule() == null ? "-" : address.getModule().getConfiguration().getName();
case ADDRESS_COLUMN:
{
if (address.getModule() == null) {
return address.getAddress().getAddress().toHexString();
} else {
final INaviFunction function = address.getModule().isLoaded() ? address.getModule().getContent().getFunctionContainer().getFunction(address.getAddress().getAddress()) : null;
if (function == null) {
return address.getAddress().getAddress().toHexString();
} else {
return function.getName();
}
}
}
default:
throw new IllegalStateException("IE01121: Unknown column");
}
}
use of com.google.security.zynamics.binnavi.debug.models.breakpoints.BreakpointAddress 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.BreakpointAddress 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.BreakpointAddress 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.BreakpointAddress 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);
}
}
Aggregations