diff --git a/src/plugins/debugger/breakwindow.cpp b/src/plugins/debugger/breakwindow.cpp index ca32d2de200..77a983e22cd 100644 --- a/src/plugins/debugger/breakwindow.cpp +++ b/src/plugins/debugger/breakwindow.cpp @@ -624,7 +624,8 @@ void BreakWindow::contextMenuEvent(QContextMenuEvent *ev) menu.addAction(synchronizeAction); menu.addSeparator(); menu.addAction(debuggerCore()->action(UseToolTipsInBreakpointsView)); - menu.addAction(debuggerCore()->action(UseAddressInBreakpointsView)); + if (debuggerCore()->currentEngine()->debuggerCapabilities() & MemoryAddressCapability) + menu.addAction(debuggerCore()->action(UseAddressInBreakpointsView)); addBaseContextActions(&menu); QAction *act = menu.exec(ev->globalPos()); diff --git a/src/plugins/debugger/cdb/cdbengine.cpp b/src/plugins/debugger/cdb/cdbengine.cpp index 25e149af239..4e6a08259d6 100644 --- a/src/plugins/debugger/cdb/cdbengine.cpp +++ b/src/plugins/debugger/cdb/cdbengine.cpp @@ -1097,7 +1097,8 @@ unsigned CdbEngine::debuggerCapabilities() const |BreakConditionCapability|TracePointCapability |BreakModuleCapability |OperateByInstructionCapability - |RunToLineCapability; + |RunToLineCapability + |MemoryAddressCapability; } void CdbEngine::executeStep() diff --git a/src/plugins/debugger/debuggerconstants.h b/src/plugins/debugger/debuggerconstants.h index 0cc7f57d447..36bff640ff6 100644 --- a/src/plugins/debugger/debuggerconstants.h +++ b/src/plugins/debugger/debuggerconstants.h @@ -163,6 +163,7 @@ enum DebuggerCapabilities CatchCapability = 0x200000, //!< fork, vfork, syscall OperateByInstructionCapability = 0x400000, RunToLineCapability = 0x800000, + MemoryAddressCapability = 0x1000000, AllDebuggerCapabilities = 0xFFFFFFFF }; diff --git a/src/plugins/debugger/gdb/gdbengine.cpp b/src/plugins/debugger/gdb/gdbengine.cpp index 8d31679bbd4..a835bf14aed 100644 --- a/src/plugins/debugger/gdb/gdbengine.cpp +++ b/src/plugins/debugger/gdb/gdbengine.cpp @@ -1999,7 +1999,8 @@ unsigned GdbEngine::debuggerCapabilities() const | ShowModuleSymbolsCapability | CatchCapability | OperateByInstructionCapability - | RunToLineCapability; + | RunToLineCapability + | MemoryAddressCapability; if (startParameters().startMode == AttachCore) return caps; diff --git a/src/plugins/debugger/stackwindow.cpp b/src/plugins/debugger/stackwindow.cpp index b417bd0c7cc..b58f2d68f46 100644 --- a/src/plugins/debugger/stackwindow.cpp +++ b/src/plugins/debugger/stackwindow.cpp @@ -112,39 +112,50 @@ void StackWindow::contextMenuEvent(QContextMenuEvent *ev) if (engineCapabilities & CreateFullBacktraceCapability) menu.addAction(debuggerCore()->action(CreateFullBacktrace)); - QAction *actShowMemory = menu.addAction(QString()); - if (address == 0) { - actShowMemory->setText(tr("Open Memory Editor")); - actShowMemory->setEnabled(false); - } else { - actShowMemory->setText(tr("Open Memory Editor at 0x%1").arg(address, 0, 16)); - actShowMemory->setEnabled(engineCapabilities & ShowMemoryCapability); + QAction *actShowMemory = 0; + if (engineCapabilities & ShowMemoryCapability) { + actShowMemory = menu.addAction(QString()); + if (address == 0) { + actShowMemory->setText(tr("Open Memory Editor")); + actShowMemory->setEnabled(false); + } else { + actShowMemory->setText(tr("Open Memory Editor at 0x%1").arg(address, 0, 16)); + actShowMemory->setEnabled(engineCapabilities & ShowMemoryCapability); + } } - QAction *actShowDisassemblerAt = menu.addAction(QString()); - QAction *actShowDisassembler = menu.addAction(tr("Open Disassembler...")); - actShowDisassembler->setEnabled(engineCapabilities & DisassemblerCapability); - if (address == 0) { - actShowDisassemblerAt->setText(tr("Open Disassembler")); - actShowDisassemblerAt->setEnabled(false); - } else { - actShowDisassemblerAt->setText(tr("Open Disassembler at 0x%1").arg(address, 0, 16)); - actShowDisassemblerAt->setEnabled(engineCapabilities & DisassemblerCapability); + QAction *actShowDisassemblerAt = 0; + QAction *actShowDisassembler = 0; + + if (engineCapabilities & DisassemblerCapability) { + actShowDisassemblerAt = menu.addAction(QString()); + actShowDisassembler = menu.addAction(tr("Open Disassembler...")); + if (address == 0) { + actShowDisassemblerAt->setText(tr("Open Disassembler")); + actShowDisassemblerAt->setEnabled(false); + } else { + actShowDisassemblerAt->setText(tr("Open Disassembler at 0x%1").arg(address, 0, 16)); + } } + QAction *actLoadSymbols = 0; if (engineCapabilities & ShowModuleSymbolsCapability) actLoadSymbols = menu.addAction(tr("Try to Load Unknown Symbols")); - menu.addSeparator(); #if 0 // @TODO: not implemented menu.addAction(debuggerCore()->action(UseToolTipsInStackView)); #endif - menu.addAction(debuggerCore()->action(UseAddressInStackView)); + if (engineCapabilities & MemoryAddressCapability) + menu.addAction(debuggerCore()->action(UseAddressInStackView)); + + menu.addSeparator(); addBaseContextActions(&menu); QAction *act = menu.exec(ev->globalPos()); + if (!act) + return; if (act == actCopyContents) copyContentsToClipboard();