use of com.google.security.zynamics.binnavi.debug.models.processmanager.TargetProcessThread in project binnavi by google.
the class CDebugEventNotifier method start.
/**
* Starts the event notifier.
*/
public void start() {
m_debugger.addListener(m_debuglistener);
final ProcessManager processManager = m_debugger.getProcessManager();
processManager.addListener(m_processListener);
for (final TargetProcessThread thread : processManager.getThreads()) {
thread.addListener(m_threadEventListener);
}
}
use of com.google.security.zynamics.binnavi.debug.models.processmanager.TargetProcessThread in project binnavi by google.
the class CMemoryViewerSynchronizer method synchronizeDebugger.
/**
* Makes sure that the synchronizer is listening on the active debugger.
*
* @param oldDebugger The previously active debugger (or null).
* @param newDebugger The currently active debugger (or null).
*/
private void synchronizeDebugger(final IDebugger oldDebugger, final IDebugger newDebugger) {
if (oldDebugger != null) {
oldDebugger.getProcessManager().removeListener(m_debuggerListener);
final TargetProcessThread activeThread = oldDebugger.getProcessManager().getActiveThread();
if (activeThread != null) {
synchronizeThreads(activeThread, null);
}
}
if (newDebugger != null) {
newDebugger.getProcessManager().addListener(m_debuggerListener);
m_provider.setDebugger(newDebugger);
final TargetProcessThread activeThread = newDebugger.getProcessManager().getActiveThread();
if (activeThread != null) {
synchronizeThreads(null, activeThread);
}
}
updateGui();
}
use of com.google.security.zynamics.binnavi.debug.models.processmanager.TargetProcessThread in project binnavi by google.
the class CMemoryFunctions method gotoOffset.
/**
* Shows the Goto Offset dialog and sets the caret of a hex control to the entered offset.
*
* @param parent Parent window used for dialogs.
* @param view Hex view to focus after the Goto operation.
* @param model Model that contains the memory viewer where the offset is changed.
*/
public static void gotoOffset(final JFrame parent, final CMemoryViewer view, final CDebugPerspectiveModel model) {
final IDebugger debugger = model.getCurrentSelectedDebugger();
if (debugger == null) {
return;
}
final TargetProcessThread activeThread = debugger.getProcessManager().getActiveThread();
final Memory memory = debugger.getProcessManager().getMemory();
final CDefaultMemoryExpressionBinding binding = new CDefaultMemoryExpressionBinding(activeThread, memory);
final CGotoDialog dlg = new CGotoDialog(parent, model.getCurrentSelectedDebugger().getProcessManager().getMemoryMap(), binding, model.getGotoAddress());
dlg.setVisible(true);
final IAddress value = dlg.getValue();
if (value != null) {
model.setGotoAddress(value);
model.setActiveMemoryAddress(value, true);
view.requestFocusInWindow();
}
}
use of com.google.security.zynamics.binnavi.debug.models.processmanager.TargetProcessThread in project binnavi by google.
the class CMemoryRefreshButtonSynchronizer method updateGui.
/**
* Updates the button according to the currently available information about the target process.
*/
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_refreshButton.setEnabled(suspended);
}
use of com.google.security.zynamics.binnavi.debug.models.processmanager.TargetProcessThread in project binnavi by google.
the class CMemorySectionPanelSynchronizer method updateGui.
/**
* Updates the GUI of the synchronized memory section box depending on the current state of the
* debug GUI perspective and the active debugger.
*/
private void updateGui() {
final IDebugger activeDebugger = debugPerspectiveModel.getCurrentSelectedDebugger();
final TargetProcessThread activeThread = activeDebugger == null ? null : activeDebugger.getProcessManager().getActiveThread();
final boolean enable = (activeThread != null) && (activeDebugger != null) && activeDebugger.isConnected() && (activeDebugger.getProcessManager().getTargetInformation() != null) && activeDebugger.getProcessManager().getTargetInformation().getDebuggerOptions().canMemmap() && (memorySectionBox.getItemCount() != 0);
new SwingInvoker() {
@Override
protected void operation() {
memorySectionBox.setEnabled(enable);
}
}.invokeAndWait();
}
Aggregations