use of com.google.security.zynamics.binnavi.Gui.Debug.Goto.CGotoDialog 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();
}
}
Aggregations