use of com.google.security.zynamics.binnavi.disassembly.views.IViewContainer in project binnavi by google.
the class CEventTableMenu method addOpenFunction.
/**
* Adds a menu item to open the selected trace.
*
* @param parent Parent window of the menu.
* @param traces The selected traces.
*/
private void addOpenFunction(final Window parent, final List<ITraceEvent> traces) {
if (traces.size() == 1) {
final ITraceEvent trace = traces.get(0);
final INaviModule module = trace.getOffset().getModule();
if (module.isLoaded()) {
final INaviFunction function = module.getContent().getFunctionContainer().getFunction(trace.getOffset().getAddress().getAddress());
if (function != null) {
final IViewContainer container = graphModel.getViewContainer();
final INaviView view = container.getView(function);
if (view != null) {
add(new JMenuItem(CActionProxy.proxy(new COpenInLastWindowAction(parent, container, new INaviView[] { view }))));
addSeparator();
}
}
}
}
}
use of com.google.security.zynamics.binnavi.disassembly.views.IViewContainer 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();
}
use of com.google.security.zynamics.binnavi.disassembly.views.IViewContainer in project binnavi by google.
the class CRegisterMenuProvider method getRegisterMenu.
@Override
public JPopupMenu getRegisterMenu(final int registerNumber) {
final IDebugger debugger = m_debugPerspectiveModel.getCurrentSelectedDebugger();
if (debugger == null) {
return null;
}
final JPopupMenu menu = new JPopupMenu();
final BigInteger value = m_dataProvider.getRegisterInformation(registerNumber).getValue();
menu.add(CActionProxy.proxy(new CCopyRegisterValueAction(value.toString(16).toUpperCase())));
final MemorySection section = ProcessHelpers.getSectionWith(debugger.getProcessManager().getMemoryMap(), new CAddress(value));
final JMenuItem gotoAddress = menu.add(CActionProxy.proxy(new CGotoOffsetAction(m_debugPerspectiveModel, new CAddress(value))));
gotoAddress.setEnabled(section != null);
if (containsAddress(m_debugPerspectiveModel.getGraphModel().getGraph().getRawView(), value.longValue())) {
menu.add(CActionProxy.proxy(new CZoomToAddressAction(m_debugPerspectiveModel.getGraphModel().getGraph(), new CAddress(value), debugger.getModule(new RelocatedAddress(new CAddress(value))))));
} else {
final IViewContainer container = m_debugPerspectiveModel.getGraphModel().getViewContainer();
menu.add(CActionProxy.proxy(new CSearchAction(m_debugPerspectiveModel.getGraphModel().getParent(), container, new CAddress(value))));
}
return menu;
}
Aggregations