use of com.google.security.zynamics.binnavi.debug.debugger.BackEndDebuggerProvider in project binnavi by google.
the class CDebugEventNotifier method activateWindow.
/**
* Activates the window of this debugger.
*
* @return The window of this debugger.
*/
private JFrame activateWindow() {
for (final IGraphContainerWindow window : CWindowManager.instance().getOpenWindows()) {
for (final IGraphPanel graphPanel : window) {
final BackEndDebuggerProvider debuggerProvider = graphPanel.getModel().getDebuggerProvider();
for (final IDebugger d : debuggerProvider) {
if (d == m_debugger) {
window.activate(graphPanel);
window.show();
return window.getFrame();
}
}
}
}
return null;
}
use of com.google.security.zynamics.binnavi.debug.debugger.BackEndDebuggerProvider in project binnavi by google.
the class CVariableHighlighterTest method test1Simple.
@Test
public void test1Simple() throws FileReadException, CouldntLoadDataException, LoadCancelledException, CouldntSaveDataException {
final ZyGraph graph = ZyGraphFactory.generateTestGraph();
final List<INaviInstruction> mockInstructions = new ArrayList<INaviInstruction>();
final CCodeNode node = graph.getRawView().getBasicBlocks().get(0);
final NaviNode naviNode = graph.getNode(node);
mockInstructions.add(Iterables.get(node.getInstructions(), 0));
final BackEndDebuggerProvider provider = new MockDebuggerProvider();
@SuppressWarnings("unused") final CCodeNodeUpdater updater = new CCodeNodeUpdater(graph, naviNode, node, provider);
assertFalse(naviNode.getRealizer().getNodeContent().getLineContent(0).hasHighlighting(CHighlightLayers.VARIABLE_LAYER));
CVariableHighlighter.highlightInstructions(graph, mockInstructions);
assertTrue(naviNode.getRealizer().getNodeContent().getLineContent(0).hasHighlighting(CHighlightLayers.VARIABLE_LAYER));
}
use of com.google.security.zynamics.binnavi.debug.debugger.BackEndDebuggerProvider in project binnavi by google.
the class CCommentUtilities method createInstructionLine.
/**
* TODO (timkornau): either comment function or find a nicer way to generate a pretty printed
* instruction line which does not depend on the graph model.
*/
public static String createInstructionLine(final INaviInstruction instruction, final CGraphModel graphModel) {
final ZyGraphViewSettings graphSettings = graphModel.getGraph().getSettings();
final BackEndDebuggerProvider provider = graphModel.getDebuggerProvider();
final INodeModifier modifier = new CDefaultModifier(graphSettings, provider);
return ZyInstructionBuilder.buildInstructionLine(instruction, graphSettings, modifier).first();
}
use of com.google.security.zynamics.binnavi.debug.debugger.BackEndDebuggerProvider in project binnavi by google.
the class CGraphSynchonizerTest method test1Simple.
// TODO this test is very artificial as it does not test a real work flow.
@Test
public void test1Simple() throws FileReadException, CouldntLoadDataException, LoadCancelledException, CouldntSaveDataException {
final ZyGraph graph = ZyGraphFactory.generateTestGraph();
final CSpecialInstructionsModel model = new CSpecialInstructionsModel();
final List<CSpecialInstruction> instructions = new ArrayList<CSpecialInstruction>();
final ITypeDescription callsDescription = model.getDescriptions().get(0);
callsDescription.setEnabled(true);
final CSpecialInstruction instruction = new CSpecialInstruction(callsDescription, Iterables.getFirst(graph.getRawView().getBasicBlocks().get(2).getInstructions(), null));
final CCodeNode node = graph.getRawView().getBasicBlocks().get(2);
final NaviNode naviNode = graph.getNode(node);
final BackEndDebuggerProvider provider = new MockDebuggerProvider();
new CCodeNodeUpdater(graph, naviNode, node, provider);
instructions.add(instruction);
model.setInstructions(instructions);
assertFalse(naviNode.getRealizer().getNodeContent().getLineContent(0).hasHighlighting(CHighlightLayers.SPECIAL_INSTRUCTION_LAYER));
final CGraphSynchronizer synchronizer = new CGraphSynchronizer(graph, model);
CTypeResultsHighlighter.updateHighlighting(graph, Lists.newArrayList(instruction));
assertTrue(naviNode.getRealizer().getNodeContent().getLineContent(0).hasHighlighting(CHighlightLayers.SPECIAL_INSTRUCTION_LAYER));
synchronizer.dispose();
}
Aggregations