Search in sources :

Example 1 with FlowGraphSettingsConfigItem

use of com.google.security.zynamics.binnavi.config.FlowGraphSettingsConfigItem in project binnavi by google.

the class CBreakpointTableTest method testAddedDebugger.

/**
   * This test is making sure that listeners are correctly attached to new debuggers.
   *
   * @throws CouldntSaveDataException
   * @throws FileReadException
   */
@Test
public void testAddedDebugger() throws CouldntSaveDataException, FileReadException {
    ConfigManager.instance().read();
    final INaviModule mockModule = new MockModule();
    final DebugTargetSettings target = new ModuleTargetSettings(mockModule);
    final DebuggerProvider debuggerProvider = new DebuggerProvider(target);
    final ZyGraphViewSettings settings = new ZyGraphViewSettings(new FlowGraphSettingsConfigItem());
    settings.getLayoutSettings().setDefaultGraphLayout(LayoutStyle.CIRCULAR);
    final ZyGraph graph = new ZyGraph(new MockView(), new LinkedHashMap<Node, NaviNode>(), new LinkedHashMap<Edge, NaviEdge>(), settings, new ZyGraph2DView());
    final IViewContainer viewContainer = new MockViewContainer();
    final CBreakpointTable table = new CBreakpointTable(debuggerProvider, graph, viewContainer);
    final MockDebugger debugger = new MockDebugger(new ModuleTargetSettings(mockModule));
    final MockModule module = new MockModule();
    debugger.getBreakpointManager().addBreakpoints(BreakpointType.REGULAR, Sets.newHashSet(new BreakpointAddress(module, new UnrelocatedAddress(new CAddress(0)))));
    debuggerProvider.addDebugger(debugger);
    table.dispose();
}
Also used : FlowGraphSettingsConfigItem(com.google.security.zynamics.binnavi.config.FlowGraphSettingsConfigItem) IViewContainer(com.google.security.zynamics.binnavi.disassembly.views.IViewContainer) MockViewContainer(com.google.security.zynamics.binnavi.disassembly.MockViewContainer) ZyGraphViewSettings(com.google.security.zynamics.binnavi.ZyGraph.ZyGraphViewSettings) MockView(com.google.security.zynamics.binnavi.disassembly.MockView) ZyGraph(com.google.security.zynamics.binnavi.yfileswrap.zygraph.ZyGraph) Node(y.base.Node) NaviNode(com.google.security.zynamics.binnavi.yfileswrap.zygraph.NaviNode) NaviNode(com.google.security.zynamics.binnavi.yfileswrap.zygraph.NaviNode) DebugTargetSettings(com.google.security.zynamics.binnavi.debug.debugger.DebugTargetSettings) ModuleTargetSettings(com.google.security.zynamics.binnavi.debug.debugger.ModuleTargetSettings) CAddress(com.google.security.zynamics.zylib.disassembly.CAddress) MockDebugger(com.google.security.zynamics.binnavi.Debug.Debugger.MockDebugger) INaviModule(com.google.security.zynamics.binnavi.disassembly.INaviModule) MockModule(com.google.security.zynamics.binnavi.disassembly.Modules.MockModule) DebuggerProvider(com.google.security.zynamics.binnavi.debug.debugger.DebuggerProvider) UnrelocatedAddress(com.google.security.zynamics.binnavi.disassembly.UnrelocatedAddress) ZyGraph2DView(com.google.security.zynamics.zylib.yfileswrap.gui.zygraph.ZyGraph2DView) BreakpointAddress(com.google.security.zynamics.binnavi.debug.models.breakpoints.BreakpointAddress) NaviEdge(com.google.security.zynamics.binnavi.yfileswrap.zygraph.NaviEdge) Edge(y.base.Edge) NaviEdge(com.google.security.zynamics.binnavi.yfileswrap.zygraph.NaviEdge) Test(org.junit.Test)

Aggregations

MockDebugger (com.google.security.zynamics.binnavi.Debug.Debugger.MockDebugger)1 ZyGraphViewSettings (com.google.security.zynamics.binnavi.ZyGraph.ZyGraphViewSettings)1 FlowGraphSettingsConfigItem (com.google.security.zynamics.binnavi.config.FlowGraphSettingsConfigItem)1 DebugTargetSettings (com.google.security.zynamics.binnavi.debug.debugger.DebugTargetSettings)1 DebuggerProvider (com.google.security.zynamics.binnavi.debug.debugger.DebuggerProvider)1 ModuleTargetSettings (com.google.security.zynamics.binnavi.debug.debugger.ModuleTargetSettings)1 BreakpointAddress (com.google.security.zynamics.binnavi.debug.models.breakpoints.BreakpointAddress)1 INaviModule (com.google.security.zynamics.binnavi.disassembly.INaviModule)1 MockView (com.google.security.zynamics.binnavi.disassembly.MockView)1 MockViewContainer (com.google.security.zynamics.binnavi.disassembly.MockViewContainer)1 MockModule (com.google.security.zynamics.binnavi.disassembly.Modules.MockModule)1 UnrelocatedAddress (com.google.security.zynamics.binnavi.disassembly.UnrelocatedAddress)1 IViewContainer (com.google.security.zynamics.binnavi.disassembly.views.IViewContainer)1 NaviEdge (com.google.security.zynamics.binnavi.yfileswrap.zygraph.NaviEdge)1 NaviNode (com.google.security.zynamics.binnavi.yfileswrap.zygraph.NaviNode)1 ZyGraph (com.google.security.zynamics.binnavi.yfileswrap.zygraph.ZyGraph)1 CAddress (com.google.security.zynamics.zylib.disassembly.CAddress)1 ZyGraph2DView (com.google.security.zynamics.zylib.yfileswrap.gui.zygraph.ZyGraph2DView)1 Test (org.junit.Test)1 Edge (y.base.Edge)1