use of com.google.security.zynamics.binnavi.debug.debugger.DebuggerProvider in project binnavi by google.
the class InstructionNode method toString.
@Override
public String toString() {
final ZyGraphViewSettings settings = new ZyGraphViewSettings(new GraphSettingsConfigItem());
final DebuggerProvider provider = new DebuggerProvider(new ModuleTargetSettings(instruction.getModule()));
return ZyInstructionBuilder.buildInstructionLine(instruction, settings, new CDefaultModifier(settings, provider)).first();
}
use of com.google.security.zynamics.binnavi.debug.debugger.DebuggerProvider in project binnavi by google.
the class CGraphDebuggerTest method testGetDebugger2.
@Test
public void testGetDebugger2() {
final MockModule module = new MockModule();
module.getConfiguration().setDebugger(m_debugger);
final DebugTargetSettings target = new ModuleTargetSettings(module);
final DebuggerProvider debuggerProvider = new DebuggerProvider(target);
debuggerProvider.addDebugger(m_debugger);
final CFunction function = new CFunction(module, new MockView(), new CAddress(0x123), "Mock Function", "Mock Function", "Mock Description", 0, 0, 0, 0, FunctionType.NORMAL, "", 0, null, null, null, m_provider);
final ArrayList<IComment> comments = Lists.<IComment>newArrayList(new CComment(null, CommonTestObjects.TEST_USER_1, null, "Mock Comment"));
final INaviCodeNode codeNode = new CCodeNode(0, 0, 0, 0, 0, Color.RED, Color.RED, false, false, comments, function, new HashSet<CTag>(), new MockSqlProvider());
codeNode.addInstruction(new CInstruction(true, module, new CAddress(0x123), "nop", new ArrayList<COperandTree>(), new byte[] { (byte) 0x90 }, "x86-32", m_provider), null);
assertEquals(m_debugger, CGraphDebugger.getDebugger(debuggerProvider, Iterables.getFirst(codeNode.getInstructions(), null)));
}
use of com.google.security.zynamics.binnavi.debug.debugger.DebuggerProvider in project binnavi by google.
the class CGraphDebuggerTest method testGetDebugger.
@Test
public void testGetDebugger() {
final MockModule module = new MockModule();
module.getConfiguration().setDebugger(m_debugger);
final DebugTargetSettings target = new ModuleTargetSettings(module);
final DebuggerProvider debuggerProvider = new DebuggerProvider(target);
debuggerProvider.addDebugger(m_debugger);
final CFunction function = new CFunction(module, new MockView(), new CAddress(0x123), "Mock Function", "Mock Function", "Mock Description", 0, 0, 0, 0, FunctionType.NORMAL, "", 0, null, null, null, m_provider);
final CFunctionNode functionNode = new CFunctionNode(0, function, 0, 0, 0, 0, Color.RED, false, false, null, new HashSet<CTag>(), m_provider);
assertEquals(m_debugger, CGraphDebugger.getDebugger(debuggerProvider, functionNode));
}
use of com.google.security.zynamics.binnavi.debug.debugger.DebuggerProvider in project binnavi by google.
the class CBookmarksTableModelTest method test1DynamicDebugger.
@Test
public void test1DynamicDebugger() {
final DebugTargetSettings target = new ModuleTargetSettings(CommonTestObjects.MODULE);
final DebuggerProvider debuggerProvider = new DebuggerProvider(target);
final CBookmarkTableModel model = new CBookmarkTableModel(debuggerProvider);
final MockDebugger debugger = new MockDebugger(new ModuleTargetSettings(CommonTestObjects.MODULE));
debugger.getBreakpointManager().addBreakpoints(BreakpointType.REGULAR, CommonTestObjects.BP_ADDRESS_0_SET);
debuggerProvider.addDebugger(debugger);
model.dispose();
}
use of com.google.security.zynamics.binnavi.debug.debugger.DebuggerProvider in project binnavi by google.
the class CBreakpointTableModelTest method test4getValueAt.
@Test
public void test4getValueAt() {
final DebugTargetSettings target = new ModuleTargetSettings(CommonTestObjects.MODULE);
final DebuggerProvider debuggerProvider = new DebuggerProvider(target);
final MockDebugger debugger = new MockDebugger(new ModuleTargetSettings(CommonTestObjects.MODULE));
debugger.getBreakpointManager().addBreakpoints(BreakpointType.REGULAR, BREAKPOINT_ADDRESS_SET);
final Breakpoint breakPoint = debugger.getBreakpointManager().getBreakpoint(BreakpointType.REGULAR, BREAKPOINT_ADDRESS);
final CAddress address = new CAddress(0);
final BaseNode root = new BaseNode();
final BreakpointCondition bpCondition = new BreakpointCondition("foo", root);
breakPoint.setCondition(bpCondition);
breakPoint.setDescription("purzel");
debuggerProvider.addDebugger(debugger);
final CBreakpointTableModel tableModel = new CBreakpointTableModel(debuggerProvider);
assertEquals(com.google.security.zynamics.binnavi.debug.models.breakpoints.enums.BreakpointStatus.BREAKPOINT_INACTIVE, tableModel.getValueAt(0, 0));
assertEquals(debugger.getPrintableString(), tableModel.getValueAt(0, 1));
assertEquals(address, tableModel.getValueAt(0, 2));
assertEquals("foo", tableModel.getValueAt(0, 5));
assertEquals("purzel", tableModel.getValueAt(0, 6));
try {
tableModel.getValueAt(0, 7);
fail();
} catch (final IllegalArgumentException e) {
}
}
Aggregations