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

Change-Id: I29f09f983146fff3301426703db0b93090c6507c
Reviewed-by: hjk <qthjk@ovi.com>
This commit is contained in:
Kai Koehne
2011-11-30 11:51:23 +01:00
parent 7140642d0e
commit 66949f2b45
5 changed files with 36 additions and 21 deletions

View File

@@ -624,6 +624,7 @@ void BreakWindow::contextMenuEvent(QContextMenuEvent *ev)
menu.addAction(synchronizeAction);
menu.addSeparator();
menu.addAction(debuggerCore()->action(UseToolTipsInBreakpointsView));
if (debuggerCore()->currentEngine()->debuggerCapabilities() & MemoryAddressCapability)
menu.addAction(debuggerCore()->action(UseAddressInBreakpointsView));
addBaseContextActions(&menu);

View File

@@ -1097,7 +1097,8 @@ unsigned CdbEngine::debuggerCapabilities() const
|BreakConditionCapability|TracePointCapability
|BreakModuleCapability
|OperateByInstructionCapability
|RunToLineCapability;
|RunToLineCapability
|MemoryAddressCapability;
}
void CdbEngine::executeStep()

View File

@@ -163,6 +163,7 @@ enum DebuggerCapabilities
CatchCapability = 0x200000, //!< fork, vfork, syscall
OperateByInstructionCapability = 0x400000,
RunToLineCapability = 0x800000,
MemoryAddressCapability = 0x1000000,
AllDebuggerCapabilities = 0xFFFFFFFF
};

View File

@@ -1999,7 +1999,8 @@ unsigned GdbEngine::debuggerCapabilities() const
| ShowModuleSymbolsCapability
| CatchCapability
| OperateByInstructionCapability
| RunToLineCapability;
| RunToLineCapability
| MemoryAddressCapability;
if (startParameters().startMode == AttachCore)
return caps;

View File

@@ -112,7 +112,9 @@ void StackWindow::contextMenuEvent(QContextMenuEvent *ev)
if (engineCapabilities & CreateFullBacktraceCapability)
menu.addAction(debuggerCore()->action(CreateFullBacktrace));
QAction *actShowMemory = menu.addAction(QString());
QAction *actShowMemory = 0;
if (engineCapabilities & ShowMemoryCapability) {
actShowMemory = menu.addAction(QString());
if (address == 0) {
actShowMemory->setText(tr("Open Memory Editor"));
actShowMemory->setEnabled(false);
@@ -120,31 +122,40 @@ void StackWindow::contextMenuEvent(QContextMenuEvent *ev)
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);
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));
actShowDisassemblerAt->setEnabled(engineCapabilities & DisassemblerCapability);
}
}
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
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();