Search in sources :

Example 31 with BreakpointManager

use of com.google.security.zynamics.binnavi.debug.models.breakpoints.BreakpointManager in project binnavi by google.

the class CFunctionViewsModel method delete.

@Override
public void delete() {
    m_module.removeListener(m_moduleListener);
    if (m_activeDebugger != null) {
        final BreakpointManager manager = m_activeDebugger.getBreakpointManager();
        manager.removeListener(m_breakpointManagerListener);
    }
    if (m_module.isLoaded()) {
        for (final IFlowgraphView view : m_module.getContent().getViewContainer().getNativeFlowgraphViews()) {
            view.removeListener(m_viewListener);
        }
        for (final INaviFunction function : m_module.getContent().getFunctionContainer().getFunctions()) {
            function.removeListener(m_viewListener);
        }
    }
}
Also used : IFlowgraphView(com.google.security.zynamics.binnavi.disassembly.IFlowgraphView) BreakpointManager(com.google.security.zynamics.binnavi.debug.models.breakpoints.BreakpointManager) INaviFunction(com.google.security.zynamics.binnavi.disassembly.INaviFunction)

Example 32 with BreakpointManager

use of com.google.security.zynamics.binnavi.debug.models.breakpoints.BreakpointManager in project binnavi by google.

the class CCodeNodeUpdater method generateContent.

@Override
public void generateContent(final IZyNodeRealizer realizer, final ZyLabelContent content) {
    ZyCodeNodeBuilder.buildContent(content, codeNode, graph.getSettings(), nodeModifier);
    for (final INaviInstruction instruction : codeNode.getInstructions()) {
        final INaviModule module = instruction.getModule();
        if ((provider != null) && (provider.getDebugger(module) != null) && graph.getSettings().getDisplaySettings().getShowMemoryAddresses(provider.getDebugger(module))) {
            final int line = CCodeNodeHelpers.instructionToLine(codeNode, instruction);
            if (line != -1) {
                final ZyLineContent lineContent = this.realizer.getNodeContent().getLineContent(line);
                // TODO(timkornau) x64
                lineContent.setTextColor(0, 8, Color.RED);
            }
        }
    }
    // Set highlighting for breakpoints and the instruction pointer.
    final INaviInstruction instruction = codeNode.getInstructions().iterator().next();
    if (instruction != null) {
        final INaviModule module = instruction.getModule();
        final IDebugger debugger = provider.getDebugger(module);
        if (debugger == null) {
            return;
        }
        final BreakpointManager manager = debugger.getBreakpointManager();
        CBreakpointPainter.paintBreakpoints(manager, node, codeNode);
        if (debugger.getProcessManager().getActiveThread() != null) {
            final RelocatedAddress instructionPointer = debugger.getProcessManager().getActiveThread().getCurrentAddress();
            final MemoryModule memoryModule = debugger.getProcessManager().getModule(instructionPointer);
            final UnrelocatedAddress unrelocatedIP = new DefaultAddressConverter(memoryModule.getBaseAddress().getAddress(), module.getConfiguration().getFileBase()).memoryToFile(instructionPointer);
            CDebuggerPainter.updateSingleNodeDebuggerHighlighting(graph, unrelocatedIP, node);
        }
    }
}
Also used : INaviModule(com.google.security.zynamics.binnavi.disassembly.INaviModule) UnrelocatedAddress(com.google.security.zynamics.binnavi.disassembly.UnrelocatedAddress) RelocatedAddress(com.google.security.zynamics.binnavi.disassembly.RelocatedAddress) DefaultAddressConverter(com.google.security.zynamics.binnavi.debug.debugger.DefaultAddressConverter) ZyLineContent(com.google.security.zynamics.zylib.gui.zygraph.realizers.ZyLineContent) BreakpointManager(com.google.security.zynamics.binnavi.debug.models.breakpoints.BreakpointManager) IDebugger(com.google.security.zynamics.binnavi.debug.debugger.interfaces.IDebugger) MemoryModule(com.google.security.zynamics.binnavi.debug.models.processmanager.MemoryModule) INaviInstruction(com.google.security.zynamics.binnavi.disassembly.INaviInstruction)

Aggregations

BreakpointManager (com.google.security.zynamics.binnavi.debug.models.breakpoints.BreakpointManager)32 IDebugger (com.google.security.zynamics.binnavi.debug.debugger.interfaces.IDebugger)16 BreakpointAddress (com.google.security.zynamics.binnavi.debug.models.breakpoints.BreakpointAddress)11 Breakpoint (com.google.security.zynamics.binnavi.debug.models.breakpoints.Breakpoint)9 RelocatedAddress (com.google.security.zynamics.binnavi.disassembly.RelocatedAddress)7 HashSet (java.util.HashSet)7 CAddress (com.google.security.zynamics.zylib.disassembly.CAddress)4 ProcessManager (com.google.security.zynamics.binnavi.debug.models.processmanager.ProcessManager)3 UnrelocatedAddress (com.google.security.zynamics.binnavi.disassembly.UnrelocatedAddress)3 MemoryModule (com.google.security.zynamics.binnavi.debug.models.processmanager.MemoryModule)2 TargetProcessThread (com.google.security.zynamics.binnavi.debug.models.processmanager.TargetProcessThread)2 RegisterValue (com.google.security.zynamics.binnavi.debug.models.targetinformation.RegisterValue)2 ThreadRegisters (com.google.security.zynamics.binnavi.debug.models.targetinformation.ThreadRegisters)2 INaviFunction (com.google.security.zynamics.binnavi.disassembly.INaviFunction)2 INaviModule (com.google.security.zynamics.binnavi.disassembly.INaviModule)2 Pair (com.google.security.zynamics.zylib.general.Pair)2 ArrayList (java.util.ArrayList)2 Test (org.junit.Test)2 MockDebugger (com.google.security.zynamics.binnavi.Debug.Debugger.MockDebugger)1 MaybeNullException (com.google.security.zynamics.binnavi.Exceptions.MaybeNullException)1