use of com.google.security.zynamics.binnavi.debug.debugger.interfaces.IDebugger in project binnavi by google.
the class CCodeNodeUpdater method removeListeners.
/**
* Removes all listeners this class has attached.
*/
private void removeListeners() {
try {
codeNode.getParentFunction().removeListener(functionUpdater);
codeNode.getParentFunction().getModule().removeListener(moduleUpdater);
} catch (final MaybeNullException exception) {
// The code nodes does not have a parent function, therefore the information
// about the parent function is not shown in the code and does not have to
// be processed when updating.
}
codeNode.removeListener(codeNodeListener);
for (final INaviInstruction instruction : codeNode.getInstructions()) {
instruction.removeListener(instructionUpdater);
}
final Iterator<CTag> it = codeNode.getTagsIterator();
while (it.hasNext()) {
it.next().removeListener(tagUpdater);
}
for (final IDebugger debugger : provider.getDebuggers()) {
debugger.getProcessManager().removeListener(debuggerUpdater);
}
provider.removeListener(debuggerProviderListener);
graph.getSettings().getDisplaySettings().removeListener(settingsUpdater);
}
use of com.google.security.zynamics.binnavi.debug.debugger.interfaces.IDebugger in project binnavi by google.
the class CFollowInDumpMenu method addFollowInDumpMenu.
/**
* Adds the menu that follow in dump menu for the clicked instruction.
*
* @param menu The code node menu that is extended.
* @param model The graph model that provides information about the graph.
* @param node The node whose menu is created.
* @param clickedObject The object that was clicked.
* @param y The y-coordinate of the click.
*/
public static void addFollowInDumpMenu(final JPopupMenu menu, final CGraphModel model, final NaviNode node, final Object clickedObject, final double y) {
Preconditions.checkNotNull(menu, "IE02371: menu argument can not be null");
Preconditions.checkNotNull(model, "IE02372: model argument can not be null");
Preconditions.checkNotNull(node, "IE02373: node argument can not be null");
final int line = node.positionToRow(y);
if (line == -1) {
return;
}
final INaviCodeNode codeNode = (INaviCodeNode) node.getRawNode();
final INaviInstruction instruction = CCodeNodeHelpers.lineToInstruction(codeNode, line);
if (instruction != null) {
final IDebugger debugger = CGraphDebugger.getDebugger(model.getDebuggerProvider(), instruction);
if ((debugger != null) && (clickedObject instanceof COperandTreeNode)) {
final TargetProcessThread activeThread = debugger.getProcessManager().getActiveThread();
if (activeThread != null) {
final CDebugPerspectiveModel viewModel = (CDebugPerspectiveModel) model.getGraphPanel().getViewModel().getModel(PerspectiveType.DebugPerspective);
final COperandTreeNode treeNode = (COperandTreeNode) clickedObject;
final boolean added = addFollowInDumpMenu(menu, viewModel, debugger, activeThread, instruction.getModule(), treeNode);
if (added) {
menu.addSeparator();
}
}
}
}
}
use of com.google.security.zynamics.binnavi.debug.debugger.interfaces.IDebugger in project binnavi by google.
the class CRegisterMenuProvider method getRegisterMenu.
@Override
public JPopupMenu getRegisterMenu(final int registerNumber) {
final IDebugger debugger = m_debugPerspectiveModel.getCurrentSelectedDebugger();
if (debugger == null) {
return null;
}
final JPopupMenu menu = new JPopupMenu();
final BigInteger value = m_dataProvider.getRegisterInformation(registerNumber).getValue();
menu.add(CActionProxy.proxy(new CCopyRegisterValueAction(value.toString(16).toUpperCase())));
final MemorySection section = ProcessHelpers.getSectionWith(debugger.getProcessManager().getMemoryMap(), new CAddress(value));
final JMenuItem gotoAddress = menu.add(CActionProxy.proxy(new CGotoOffsetAction(m_debugPerspectiveModel, new CAddress(value))));
gotoAddress.setEnabled(section != null);
if (containsAddress(m_debugPerspectiveModel.getGraphModel().getGraph().getRawView(), value.longValue())) {
menu.add(CActionProxy.proxy(new CZoomToAddressAction(m_debugPerspectiveModel.getGraphModel().getGraph(), new CAddress(value), debugger.getModule(new RelocatedAddress(new CAddress(value))))));
} else {
final IViewContainer container = m_debugPerspectiveModel.getGraphModel().getViewContainer();
menu.add(CActionProxy.proxy(new CSearchAction(m_debugPerspectiveModel.getGraphModel().getParent(), container, new CAddress(value))));
}
return menu;
}
use of com.google.security.zynamics.binnavi.debug.debugger.interfaces.IDebugger 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());
}
use of com.google.security.zynamics.binnavi.debug.debugger.interfaces.IDebugger 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);
}
}
Aggregations