Search in sources :

Example 86 with TargetProcessThread

use of com.google.security.zynamics.binnavi.debug.models.processmanager.TargetProcessThread 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 87 with TargetProcessThread

use of com.google.security.zynamics.binnavi.debug.models.processmanager.TargetProcessThread in project binnavi by google.

the class CRegisterViewSynchronizer method synchronizeDebugger.

/**
   *
   *
   * @param oldDebugger
   * @param activeDebugger
   */
private void synchronizeDebugger(final IDebugger oldDebugger, final IDebugger activeDebugger) {
    TargetProcessThread oldThread = null;
    if (oldDebugger != null) {
        oldDebugger.getProcessManager().removeListener(m_processListener);
        oldThread = oldDebugger.getProcessManager().getActiveThread();
    }
    if (activeDebugger != null) {
        final TargetInformation targetInformation = activeDebugger.getProcessManager().getTargetInformation();
        if (targetInformation != null) {
            m_dataProvider.setRegisterDescription(targetInformation.getRegisters());
        }
        activeDebugger.getProcessManager().addListener(m_processListener);
        synchronizeThread(oldThread, activeDebugger.getProcessManager().getActiveThread());
    }
}
Also used : TargetProcessThread(com.google.security.zynamics.binnavi.debug.models.processmanager.TargetProcessThread) TargetInformation(com.google.security.zynamics.binnavi.debug.models.targetinformation.TargetInformation)

Example 88 with TargetProcessThread

use of com.google.security.zynamics.binnavi.debug.models.processmanager.TargetProcessThread in project binnavi by google.

the class CThreadInformationTableRenderer method getTableCellRendererComponent.

@Override
public Component getTableCellRendererComponent(final JTable table, final Object value, final boolean isSelected, final boolean hasFocus, final int row, final int column) {
    super.getTableCellRendererComponent(table, value, isSelected, hasFocus, row, column);
    final TargetProcessThread module = ((CThreadInformationTable) table).getModel().getThreads().get(row);
    final Color color = m_colorGenerator.getColor(module);
    setBackground(color == null ? Color.WHITE : color);
    return this;
}
Also used : TargetProcessThread(com.google.security.zynamics.binnavi.debug.models.processmanager.TargetProcessThread) Color(java.awt.Color)

Example 89 with TargetProcessThread

use of com.google.security.zynamics.binnavi.debug.models.processmanager.TargetProcessThread in project binnavi by google.

the class CThreadPanelSynchronizer method updateGui.

/**
   * Re-populates the thread box with all the threads of the currently selected debugger.
   */
private void updateGui() {
    m_tidBox.removeAllItems();
    final IDebugger debugger = m_debugPerspectiveModel.getCurrentSelectedDebugger();
    if (debugger == null) {
        m_tidBox.setEnabled(false);
    } else {
        final List<TargetProcessThread> threads = debugger.getProcessManager().getThreads();
        for (final TargetProcessThread thread : threads) {
            m_tidBox.addItem(thread);
        }
        if (!threads.isEmpty()) {
            m_tidBox.setSelectedIndex(0);
        }
        m_tidBox.setEnabled(true);
    }
}
Also used : TargetProcessThread(com.google.security.zynamics.binnavi.debug.models.processmanager.TargetProcessThread) IDebugger(com.google.security.zynamics.binnavi.debug.debugger.interfaces.IDebugger)

Example 90 with TargetProcessThread

use of com.google.security.zynamics.binnavi.debug.models.processmanager.TargetProcessThread in project binnavi by google.

the class CMemorySectionPanelSynchronizer method synchronizeDebugger.

/**
   * Keeps the memory section box synchronized with the currently active debugger of the debug GUI
   * perspective.
   *
   * @param oldDebugger The previously active debugger.
   * @param newDebugger The currently active debugger.
   */
private void synchronizeDebugger(final IDebugger oldDebugger, final IDebugger newDebugger) {
    TargetProcessThread oldThread = null;
    if (oldDebugger != null) {
        oldDebugger.getProcessManager().removeListener(processManagerListener);
        oldThread = oldDebugger.getProcessManager().getActiveThread();
    }
    if (newDebugger != null) {
        newDebugger.getProcessManager().addListener(processManagerListener);
        final TargetInformation targetInformation = newDebugger.getProcessManager().getTargetInformation();
        if (targetInformation != null) {
            updateMemoryBox();
        }
        synchronizeThreads(oldThread, newDebugger.getProcessManager().getActiveThread());
    }
    updateGui();
}
Also used : TargetProcessThread(com.google.security.zynamics.binnavi.debug.models.processmanager.TargetProcessThread) TargetInformation(com.google.security.zynamics.binnavi.debug.models.targetinformation.TargetInformation)

Aggregations

TargetProcessThread (com.google.security.zynamics.binnavi.debug.models.processmanager.TargetProcessThread)91 Test (org.junit.Test)50 CAddress (com.google.security.zynamics.zylib.disassembly.CAddress)27 RelocatedAddress (com.google.security.zynamics.binnavi.disassembly.RelocatedAddress)22 TargetInformation (com.google.security.zynamics.binnavi.debug.models.targetinformation.TargetInformation)21 MockDebugger (com.google.security.zynamics.binnavi.Debug.Debugger.MockDebugger)20 ModuleTargetSettings (com.google.security.zynamics.binnavi.debug.debugger.ModuleTargetSettings)20 DebuggerOptions (com.google.security.zynamics.binnavi.debug.models.targetinformation.DebuggerOptions)20 MemoryMap (com.google.security.zynamics.binnavi.debug.models.processmanager.MemoryMap)19 MemorySection (com.google.security.zynamics.binnavi.debug.models.processmanager.MemorySection)18 RegisterDescription (com.google.security.zynamics.binnavi.debug.models.targetinformation.RegisterDescription)17 IDebugger (com.google.security.zynamics.binnavi.debug.debugger.interfaces.IDebugger)16 TargetInformationReply (com.google.security.zynamics.binnavi.debug.connection.packets.replies.TargetInformationReply)15 ArrayList (java.util.ArrayList)15 MemoryMapReply (com.google.security.zynamics.binnavi.debug.connection.packets.replies.MemoryMapReply)14 RegisterValue (com.google.security.zynamics.binnavi.debug.models.targetinformation.RegisterValue)14 MemoryModule (com.google.security.zynamics.binnavi.debug.models.processmanager.MemoryModule)12 ProcessManager (com.google.security.zynamics.binnavi.debug.models.processmanager.ProcessManager)12 MaybeNullException (com.google.security.zynamics.binnavi.Exceptions.MaybeNullException)10 ThreadRegisters (com.google.security.zynamics.binnavi.debug.models.targetinformation.ThreadRegisters)9