use of com.google.security.zynamics.binnavi.debug.models.breakpoints.BreakpointAddress in project binnavi by google.
the class CBreakpointRemoveFunctions method removeAllView.
/**
* Removes all breakpoints of a given breakpoint manager that belong to a given view.
*
* @param manager The breakpoints manager whose breakpoints are removed.
* @param view The view that decides what breakpoints are removed.
*/
private static void removeAllView(final BreakpointManager manager, final INaviView view) {
final Set<BreakpointAddress> addresses = 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())) {
addresses.add(address);
}
}
CGraphDebugger.removeBreakpoints(addresses, manager);
}
use of com.google.security.zynamics.binnavi.debug.models.breakpoints.BreakpointAddress in project binnavi by google.
the class CBreakpointSetFunctions method enableAllView.
/**
* Enables all breakpoints of a given breakpoint manager that belong to a given view.
*
* @param manager The breakpoints manager whose breakpoints are enabled.
* @param view The view that decides what breakpoints are enabled.
*/
private static void enableAllView(final BreakpointManager manager, final INaviView view) {
final Set<BreakpointAddress> addressesToEnable = 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())) {
addressesToEnable.add(address);
}
}
manager.setBreakpointStatus(addressesToEnable, BreakpointType.REGULAR, BreakpointStatus.BREAKPOINT_ENABLED);
}
use of com.google.security.zynamics.binnavi.debug.models.breakpoints.BreakpointAddress in project binnavi by google.
the class CTraceCombinationFunctions method createCombinedTrace.
/**
* Fills a combined trace from the events of multiple input traces.
*
* @param newTrace The trace to fill.
* @param traces The input events.
* @param addresses The addresses of the events to put into the combined trace.
*/
private static void createCombinedTrace(final TraceList newTrace, final List<TraceList> traces, final Set<BreakpointAddress> addresses) {
final Set<BreakpointAddress> visitedAddresses = new LinkedHashSet<BreakpointAddress>();
for (final TraceList trace : traces) {
for (final ITraceEvent event : trace) {
final BreakpointAddress address = event.getOffset();
if (!addresses.contains(address)) {
continue;
}
if (visitedAddresses.contains(address)) {
continue;
}
visitedAddresses.add(address);
newTrace.addEvent(event);
}
}
}
use of com.google.security.zynamics.binnavi.debug.models.breakpoints.BreakpointAddress in project binnavi by google.
the class CTraceFunctions method setBreakpoints.
/**
* Sets breakpoints on trace events.
*
* @param model Provides the active debugger.
* @param events Events on which breakpoints are set.
*/
public static void setBreakpoints(final CDebugPerspectiveModel model, final List<ITraceEvent> events) {
final IDebugger debugger = model.getCurrentSelectedDebugger();
if (debugger == null) {
return;
}
final List<INaviModule> modules = debugger.getModules();
final Set<BreakpointAddress> addresses = new HashSet<BreakpointAddress>();
for (final ITraceEvent event : events) {
final BreakpointAddress address = event.getOffset();
if ((address.getModule() == null) || (modules.contains(address.getModule()) && !debugger.getBreakpointManager().hasBreakpoint(BreakpointType.REGULAR, address))) {
addresses.add(address);
}
}
debugger.getBreakpointManager().addBreakpoints(BreakpointType.REGULAR, addresses);
}
use of com.google.security.zynamics.binnavi.debug.models.breakpoints.BreakpointAddress in project binnavi by google.
the class TraceEventTest method testConstructor.
@Test
public void testConstructor() {
final MockModule module = new MockModule();
final TraceEvent event = new TraceEvent(new com.google.security.zynamics.binnavi.debug.models.trace.TraceEvent(0, new BreakpointAddress(module, new UnrelocatedAddress(new CAddress(0x123))), TraceEventType.ECHO_BREAKPOINT, new ArrayList<com.google.security.zynamics.binnavi.debug.models.trace.TraceRegister>()));
assertEquals(0x123, event.getAddress().toLong());
assertEquals(com.google.security.zynamics.binnavi.API.disassembly.TraceEventType.EchoBreakpoint, event.getType());
assertEquals("Trace Event [EchoBreakpoint : 123]", event.toString());
}
Aggregations