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();
}
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 HaltSynchronizer method handleSuccess.
@Override
protected void handleSuccess(final HaltReply reply) {
final ProcessManager processManager = getDebugger().getProcessManager();
try {
final TargetProcessThread thread = processManager.getThread(reply.getTid());
processManager.setActiveThread(thread);
} catch (final MaybeNullException e) {
NaviLogger.severe("Error: Process manager could not set active threads. Exception %s", e);
// Apparently there is no thread with the specified TID.
// This is not necessarily an error because the thread might have
// been closed while this handler was active.
// Nevertheless this should be logged.
}
}
use of com.google.security.zynamics.binnavi.debug.models.processmanager.TargetProcessThread in project binnavi by google.
the class ModuleLoadedSynchronizer method setActiveThreadById.
/**
* Sets the currently active thread in the process manager.
*
* @param threadId The thread id to be activated.
*/
private static void setActiveThreadById(final ProcessManager processManager, final long threadId) {
try {
final TargetProcessThread thread = processManager.getThread(threadId);
processManager.setActiveThread(thread);
} catch (final MaybeNullException exception) {
CUtilityFunctions.logException(exception);
}
}
use of com.google.security.zynamics.binnavi.debug.models.processmanager.TargetProcessThread in project binnavi by google.
the class ProcessStartSynchronizer method handleSuccess.
@Override
protected void handleSuccess(final ProcessStartReply reply) {
final TargetProcessThread thread = reply.getProcessStart().getThread();
final MemoryModule module = reply.getProcessStart().getModule();
getDebugger().getProcessManager().addThread(thread);
getDebugger().getProcessManager().setActiveThread(thread);
refreshRegisters();
CRelocationNotifier.relocateModule(getDebugger(), module);
getDebugger().getProcessManager().addModule(module);
CBreakpointModuleSynchronizer.enableRegularBreakpoints(getDebugger(), module);
try {
getDebugger().resume();
} catch (final DebugExceptionWrapper e) {
NaviLogger.severe("Error: Could not resume debugger. Exception: %s", e);
}
}
Aggregations