Search in sources :

Example 41 with IDebugger

use of com.google.security.zynamics.binnavi.debug.debugger.interfaces.IDebugger in project binnavi by google.

the class CRegisterViewSynchronizer method updateGui.

/**
 * Updates the GUI according to the state of the debugger.
 */
private void updateGui() {
    final IDebugger activeDebugger = m_debugPerspectiveModel.getCurrentSelectedDebugger();
    final TargetProcessThread activeThread = activeDebugger == null ? null : activeDebugger.getProcessManager().getActiveThread();
    m_registerView.setEnabled(activeThread != null && activeDebugger != null && activeDebugger.isConnected());
}
Also used : TargetProcessThread(com.google.security.zynamics.binnavi.debug.models.processmanager.TargetProcessThread) IDebugger(com.google.security.zynamics.binnavi.debug.debugger.interfaces.IDebugger)

Example 42 with IDebugger

use of com.google.security.zynamics.binnavi.debug.debugger.interfaces.IDebugger in project binnavi by google.

the class CRefreshAction method actionPerformed.

@Override
public void actionPerformed(final ActionEvent event) {
    final IDebugger debugger = m_debugPerspectiveModel.getCurrentSelectedDebugger();
    if (debugger != null) {
        CMemorySelectionFunctions.refreshMemory(m_parent, debugger, m_rangeProvider.getAddress(), m_rangeProvider.getSize());
        final IAddress stackAddress = m_stackRangeProvider.getAddress();
        final int size = m_stackRangeProvider.getSize();
        if (stackAddress != null && size != 0) {
            CMemorySelectionFunctions.refreshMemory(m_parent, debugger, stackAddress, size);
        }
    }
}
Also used : IDebugger(com.google.security.zynamics.binnavi.debug.debugger.interfaces.IDebugger) IAddress(com.google.security.zynamics.zylib.disassembly.IAddress)

Example 43 with IDebugger

use of com.google.security.zynamics.binnavi.debug.debugger.interfaces.IDebugger in project binnavi by google.

the class CMemorySectionPanelSynchronizer method dispose.

/**
 * Frees allocated resources.
 */
public void dispose() {
    memorySectionBox.removeItemListener(memoryBoxListener);
    debugPerspectiveModel.removeListener(debugListener);
    final IDebugger activeDebugger = debugPerspectiveModel.getCurrentSelectedDebugger();
    if (activeDebugger != null) {
        synchronizeThreads(activeDebugger.getProcessManager().getActiveThread(), null);
    }
    synchronizeDebugger(debugPerspectiveModel.getCurrentSelectedDebugger(), null);
}
Also used : IDebugger(com.google.security.zynamics.binnavi.debug.debugger.interfaces.IDebugger)

Example 44 with IDebugger

use of com.google.security.zynamics.binnavi.debug.debugger.interfaces.IDebugger in project binnavi by google.

the class CMemoryViewerSynchronizer method resizeData.

/**
 * Adjusts size, base offset, and current offset of the hex view depending on a given address and
 * the memory sections known to the debugger.
 *
 * @param address The memory address to consider.
 *
 * @return True, if the hex view was adjusted. False, if the address is not in any known memory
 *         section.
 */
private boolean resizeData(final IAddress address) {
    if (address == null) {
        return true;
    }
    final IDebugger debugger = m_debugPerspectiveModel.getCurrentSelectedDebugger();
    if (debugger != null) {
        final MemorySection section = ProcessHelpers.getSectionWith(debugger.getProcessManager().getMemoryMap(), address);
        if (section == null) {
            // No section with the given memory address
            m_debugPerspectiveModel.setActiveMemoryAddress(null, false);
            return false;
        } else {
            m_hexView.setBaseAddress(section.getStart().toLong());
            m_provider.setMemorySize(section.getSize());
            m_hexView.gotoOffset(address.toLong());
            updateGui();
            return true;
        }
    }
    return true;
}
Also used : MemorySection(com.google.security.zynamics.binnavi.debug.models.processmanager.MemorySection) IDebugger(com.google.security.zynamics.binnavi.debug.debugger.interfaces.IDebugger)

Example 45 with IDebugger

use of com.google.security.zynamics.binnavi.debug.debugger.interfaces.IDebugger in project binnavi by google.

the class CMemoryViewerSynchronizer method updateGui.

/**
 * Updates the GUI depending on the state of the active debugger.
 */
private void updateGui() {
    final IDebugger debugger = m_debugPerspectiveModel.getCurrentSelectedDebugger();
    final TargetProcessThread thread = debugger == null ? null : debugger.getProcessManager().getActiveThread();
    final boolean connected = debugger != null && debugger.isConnected();
    final boolean suspended = connected && thread != null;
    m_hexView.setEnabled(connected && suspended && m_provider.getDataLength() != 0);
    if (connected) {
        m_hexView.setDefinitionStatus(DefinitionStatus.DEFINED);
    } else {
        // m_hexView.setDefinitionStatus(DefinitionStatus.UNDEFINED);
        m_provider.setMemorySize(0);
        m_hexView.setBaseAddress(0);
        m_hexView.uncolorizeAll();
    }
}
Also used : TargetProcessThread(com.google.security.zynamics.binnavi.debug.models.processmanager.TargetProcessThread) IDebugger(com.google.security.zynamics.binnavi.debug.debugger.interfaces.IDebugger)

Aggregations

IDebugger (com.google.security.zynamics.binnavi.debug.debugger.interfaces.IDebugger)62 BreakpointManager (com.google.security.zynamics.binnavi.debug.models.breakpoints.BreakpointManager)16 TargetProcessThread (com.google.security.zynamics.binnavi.debug.models.processmanager.TargetProcessThread)16 MockDebugger (com.google.security.zynamics.binnavi.Debug.Debugger.MockDebugger)6 ModuleTargetSettings (com.google.security.zynamics.binnavi.debug.debugger.ModuleTargetSettings)6 Breakpoint (com.google.security.zynamics.binnavi.debug.models.breakpoints.Breakpoint)6 BreakpointAddress (com.google.security.zynamics.binnavi.debug.models.breakpoints.BreakpointAddress)6 CAddress (com.google.security.zynamics.zylib.disassembly.CAddress)6 Test (org.junit.Test)6 MemorySection (com.google.security.zynamics.binnavi.debug.models.processmanager.MemorySection)5 INaviModule (com.google.security.zynamics.binnavi.disassembly.INaviModule)5 UnrelocatedAddress (com.google.security.zynamics.binnavi.disassembly.UnrelocatedAddress)5 CDebugPerspectiveModel (com.google.security.zynamics.binnavi.Gui.GraphWindows.Panels.CDebugPerspectiveModel)4 INaviFunction (com.google.security.zynamics.binnavi.disassembly.INaviFunction)4 INaviInstruction (com.google.security.zynamics.binnavi.disassembly.INaviInstruction)4 BookmarkManager (com.google.security.zynamics.binnavi.models.Bookmarks.memory.BookmarkManager)4 IAddress (com.google.security.zynamics.zylib.disassembly.IAddress)4 Pair (com.google.security.zynamics.zylib.general.Pair)4 ArrayList (java.util.ArrayList)4 IGraphModel (com.google.security.zynamics.binnavi.Gui.GraphWindows.IGraphModel)3