use of com.google.security.zynamics.binnavi.ZyGraph.Menus.Actions.CGotoOperandExpressionAction in project binnavi by google.
the class CFollowInDumpMenu method addFollowInDumpMenu.
/**
* Checks what follow in dump menus are needed and adds those that are missing.
*
* @param menu The popup menu to extend.
* @param viewModel Debug perspective model that shows the memory.
* @param debugger Provides the register values.
* @param activeThread The thread whose register values should be considered.
* @param module Needed for relocation information.
* @param treeNode The clicked operand tree node.
*
* @return True, if at least one menu was added. False, otherwise.
*/
private static boolean addFollowInDumpMenu(final JPopupMenu menu, final CDebugPerspectiveModel viewModel, final IDebugger debugger, final TargetProcessThread activeThread, final INaviModule module, final COperandTreeNode treeNode) {
final BigInteger simpleAddress = getSimpleAddress(treeNode, activeThread.getRegisterValues(), debugger, module);
if ((simpleAddress != null) && needsSimpleFollowMenu(debugger, treeNode, simpleAddress)) {
menu.add(new CGotoOperandExpressionAction(viewModel, treeNode.getValue(), simpleAddress));
return true;
}
final BigInteger expressionAddress = getExpressionAddress(treeNode, activeThread.getRegisterValues(), debugger, module);
// Don't show menu twice for instructions like "mov eax, [someSymbol]"
if ((expressionAddress != null) && !expressionAddress.equals(simpleAddress) && needsAddressExpressionMenu(debugger, treeNode, expressionAddress)) {
final INaviOperandTreeNode addressExpression = getAddressExpression(treeNode);
menu.add(new CGotoOperandExpressionAction(viewModel, toString(addressExpression), expressionAddress));
return true;
}
return false;
}
Aggregations