Commit 66949f2b authored by Kai Koehne's avatar Kai Koehne
Browse files

Debugger: Hide memory related actions in context menus for QML only



Change-Id: I29f09f983146fff3301426703db0b93090c6507c
Reviewed-by: default avatarhjk <qthjk@ovi.com>
parent 7140642d
......@@ -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());
......
......@@ -1097,7 +1097,8 @@ unsigned CdbEngine::debuggerCapabilities() const
|BreakConditionCapability|TracePointCapability
|BreakModuleCapability
|OperateByInstructionCapability
|RunToLineCapability;
|RunToLineCapability
|MemoryAddressCapability;
}
void CdbEngine::executeStep()
......
......@@ -163,6 +163,7 @@ enum DebuggerCapabilities
CatchCapability = 0x200000, //!< fork, vfork, syscall
OperateByInstructionCapability = 0x400000,
RunToLineCapability = 0x800000,
MemoryAddressCapability = 0x1000000,
AllDebuggerCapabilities = 0xFFFFFFFF
};
......
......@@ -1999,7 +1999,8 @@ unsigned GdbEngine::debuggerCapabilities() const
| ShowModuleSymbolsCapability
| CatchCapability
| OperateByInstructionCapability
| RunToLineCapability;
| RunToLineCapability
| MemoryAddressCapability;
if (startParameters().startMode == AttachCore)
return caps;
......
......@@ -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();
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment