use of com.google.security.zynamics.binnavi.debug.models.processmanager.TargetProcessThread in project binnavi by google.
the class CRegisterViewSynchronizer method dispose.
/**
* Cleans up allocated resources.
*/
public void dispose() {
m_debugPerspectiveModel.removeListener(m_debugListener);
final IDebugger activeDebugger = m_debugPerspectiveModel.getCurrentSelectedDebugger();
final TargetProcessThread activeThread = activeDebugger == null ? null : activeDebugger.getProcessManager().getActiveThread();
if (activeThread != null) {
activeThread.removeListener(m_threadListener);
}
}
use of com.google.security.zynamics.binnavi.debug.models.processmanager.TargetProcessThread in project binnavi by google.
the class CStackViewSynchronizer method updateGui.
/**
* Updates the GUI depending on the current state of the target process.
*/
private void updateGui() {
final IDebugger activeDebugger = m_debugPerspectiveModel.getCurrentSelectedDebugger();
final TargetProcessThread activeThread = activeDebugger == null ? null : activeDebugger.getProcessManager().getActiveThread();
if (activeThread == null) {
m_stackView.setDefinitionStatus(DefinitionStatus.UNDEFINED);
m_stackView.setEnabled(false);
} else {
m_stackView.setDefinitionStatus(DefinitionStatus.DEFINED);
m_stackView.setEnabled(true);
m_stackView.gotoOffset(getStackPointer(activeThread));
}
}
use of com.google.security.zynamics.binnavi.debug.models.processmanager.TargetProcessThread in project binnavi by google.
the class CStackViewSynchronizer method synchronizeDebuggers.
/**
* Makes sure that listeners are added at the right debuggers.
*
* @param oldDebugger The previously active debugger.
* @param newDebugger The newly active debugger.
*/
private void synchronizeDebuggers(final IDebugger oldDebugger, final IDebugger newDebugger) {
if (oldDebugger != null) {
oldDebugger.getProcessManager().removeListener(m_processListener);
final TargetProcessThread activeThread = oldDebugger.getProcessManager().getActiveThread();
synchronizeThread(activeThread, null);
}
if (newDebugger != null) {
newDebugger.getProcessManager().addListener(m_processListener);
final TargetProcessThread activeThread = newDebugger.getProcessManager().getActiveThread();
synchronizeThread(null, activeThread);
}
}
use of com.google.security.zynamics.binnavi.debug.models.processmanager.TargetProcessThread in project binnavi by google.
the class CStepIntoAction method actionPerformed.
@Override
public void actionPerformed(final ActionEvent event) {
final IDebugger debugger = m_debugger.getCurrentSelectedDebugger();
final TargetProcessThread activeThread = debugger == null ? null : debugger.getProcessManager().getActiveThread();
if ((debugger != null) && (activeThread != null)) {
CDebuggerFunctions.stepInto(m_parent, debugger);
}
}
use of com.google.security.zynamics.binnavi.debug.models.processmanager.TargetProcessThread in project binnavi by google.
the class CDebuggerToolbar method updateGui.
/**
* Updates the GUI according to the currently available information about the target process.
*/
public void updateGui() {
// Note: There is a reason for why we have to update the toolbar
// from the outside. The toolbar can not update itself because
// the toolbar state depends on the state of the TID box in the
// debug panel.
final IDebugger debugger = m_debugger.getCurrentSelectedDebugger();
final TargetProcessThread activeThread = debugger == null ? null : debugger.getProcessManager().getActiveThread();
final boolean connected = (debugger != null) && debugger.isConnected();
final boolean suspended = connected && (activeThread != null);
m_startAction.setEnabled(!connected);
final boolean haltBeforeCommunicating = (debugger != null) && connected && (debugger.getProcessManager().getTargetInformation() != null) && debugger.getProcessManager().getTargetInformation().getDebuggerOptions().mustHaltBeforeCommunicating();
m_detachAction.setEnabled(connected && (!haltBeforeCommunicating || suspended));
m_terminateAction.setEnabled(connected);
m_stepIntoAction.setEnabled(connected && suspended);
m_stepIntoAction.setEnabled(connected && suspended);
m_stepOverAction.setEnabled(connected && suspended);
m_stepBlockAction.setEnabled(connected && suspended);
m_stepEndAction.setEnabled(connected && suspended);
m_resumeAction.setEnabled(connected && suspended);
m_haltAction.setEnabled(connected && !suspended);
final boolean tracing = (debugger != null) && m_debugger.getTraceLogger(debugger).hasEchoBreakpoints();
m_startTraceAction.setEnabled(connected && (!haltBeforeCommunicating || suspended));
m_stopTraceAction.setEnabled(connected && tracing && (!haltBeforeCommunicating || suspended));
}
Aggregations