forked from qt-creator/qt-creator
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:
@@ -624,7 +624,8 @@ void BreakWindow::contextMenuEvent(QContextMenuEvent *ev)
|
|||||||
menu.addAction(synchronizeAction);
|
menu.addAction(synchronizeAction);
|
||||||
menu.addSeparator();
|
menu.addSeparator();
|
||||||
menu.addAction(debuggerCore()->action(UseToolTipsInBreakpointsView));
|
menu.addAction(debuggerCore()->action(UseToolTipsInBreakpointsView));
|
||||||
menu.addAction(debuggerCore()->action(UseAddressInBreakpointsView));
|
if (debuggerCore()->currentEngine()->debuggerCapabilities() & MemoryAddressCapability)
|
||||||
|
menu.addAction(debuggerCore()->action(UseAddressInBreakpointsView));
|
||||||
addBaseContextActions(&menu);
|
addBaseContextActions(&menu);
|
||||||
|
|
||||||
QAction *act = menu.exec(ev->globalPos());
|
QAction *act = menu.exec(ev->globalPos());
|
||||||
|
|||||||
@@ -1097,7 +1097,8 @@ unsigned CdbEngine::debuggerCapabilities() const
|
|||||||
|BreakConditionCapability|TracePointCapability
|
|BreakConditionCapability|TracePointCapability
|
||||||
|BreakModuleCapability
|
|BreakModuleCapability
|
||||||
|OperateByInstructionCapability
|
|OperateByInstructionCapability
|
||||||
|RunToLineCapability;
|
|RunToLineCapability
|
||||||
|
|MemoryAddressCapability;
|
||||||
}
|
}
|
||||||
|
|
||||||
void CdbEngine::executeStep()
|
void CdbEngine::executeStep()
|
||||||
|
|||||||
@@ -163,6 +163,7 @@ enum DebuggerCapabilities
|
|||||||
CatchCapability = 0x200000, //!< fork, vfork, syscall
|
CatchCapability = 0x200000, //!< fork, vfork, syscall
|
||||||
OperateByInstructionCapability = 0x400000,
|
OperateByInstructionCapability = 0x400000,
|
||||||
RunToLineCapability = 0x800000,
|
RunToLineCapability = 0x800000,
|
||||||
|
MemoryAddressCapability = 0x1000000,
|
||||||
AllDebuggerCapabilities = 0xFFFFFFFF
|
AllDebuggerCapabilities = 0xFFFFFFFF
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -1999,7 +1999,8 @@ unsigned GdbEngine::debuggerCapabilities() const
|
|||||||
| ShowModuleSymbolsCapability
|
| ShowModuleSymbolsCapability
|
||||||
| CatchCapability
|
| CatchCapability
|
||||||
| OperateByInstructionCapability
|
| OperateByInstructionCapability
|
||||||
| RunToLineCapability;
|
| RunToLineCapability
|
||||||
|
| MemoryAddressCapability;
|
||||||
|
|
||||||
if (startParameters().startMode == AttachCore)
|
if (startParameters().startMode == AttachCore)
|
||||||
return caps;
|
return caps;
|
||||||
|
|||||||
@@ -112,39 +112,50 @@ void StackWindow::contextMenuEvent(QContextMenuEvent *ev)
|
|||||||
if (engineCapabilities & CreateFullBacktraceCapability)
|
if (engineCapabilities & CreateFullBacktraceCapability)
|
||||||
menu.addAction(debuggerCore()->action(CreateFullBacktrace));
|
menu.addAction(debuggerCore()->action(CreateFullBacktrace));
|
||||||
|
|
||||||
QAction *actShowMemory = menu.addAction(QString());
|
QAction *actShowMemory = 0;
|
||||||
if (address == 0) {
|
if (engineCapabilities & ShowMemoryCapability) {
|
||||||
actShowMemory->setText(tr("Open Memory Editor"));
|
actShowMemory = menu.addAction(QString());
|
||||||
actShowMemory->setEnabled(false);
|
if (address == 0) {
|
||||||
} else {
|
actShowMemory->setText(tr("Open Memory Editor"));
|
||||||
actShowMemory->setText(tr("Open Memory Editor at 0x%1").arg(address, 0, 16));
|
actShowMemory->setEnabled(false);
|
||||||
actShowMemory->setEnabled(engineCapabilities & ShowMemoryCapability);
|
} else {
|
||||||
|
actShowMemory->setText(tr("Open Memory Editor at 0x%1").arg(address, 0, 16));
|
||||||
|
actShowMemory->setEnabled(engineCapabilities & ShowMemoryCapability);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
QAction *actShowDisassemblerAt = menu.addAction(QString());
|
QAction *actShowDisassemblerAt = 0;
|
||||||
QAction *actShowDisassembler = menu.addAction(tr("Open Disassembler..."));
|
QAction *actShowDisassembler = 0;
|
||||||
actShowDisassembler->setEnabled(engineCapabilities & DisassemblerCapability);
|
|
||||||
if (address == 0) {
|
if (engineCapabilities & DisassemblerCapability) {
|
||||||
actShowDisassemblerAt->setText(tr("Open Disassembler"));
|
actShowDisassemblerAt = menu.addAction(QString());
|
||||||
actShowDisassemblerAt->setEnabled(false);
|
actShowDisassembler = menu.addAction(tr("Open Disassembler..."));
|
||||||
} else {
|
if (address == 0) {
|
||||||
actShowDisassemblerAt->setText(tr("Open Disassembler at 0x%1").arg(address, 0, 16));
|
actShowDisassemblerAt->setText(tr("Open Disassembler"));
|
||||||
actShowDisassemblerAt->setEnabled(engineCapabilities & DisassemblerCapability);
|
actShowDisassemblerAt->setEnabled(false);
|
||||||
|
} else {
|
||||||
|
actShowDisassemblerAt->setText(tr("Open Disassembler at 0x%1").arg(address, 0, 16));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
QAction *actLoadSymbols = 0;
|
QAction *actLoadSymbols = 0;
|
||||||
if (engineCapabilities & ShowModuleSymbolsCapability)
|
if (engineCapabilities & ShowModuleSymbolsCapability)
|
||||||
actLoadSymbols = menu.addAction(tr("Try to Load Unknown Symbols"));
|
actLoadSymbols = menu.addAction(tr("Try to Load Unknown Symbols"));
|
||||||
|
|
||||||
menu.addSeparator();
|
|
||||||
#if 0 // @TODO: not implemented
|
#if 0 // @TODO: not implemented
|
||||||
menu.addAction(debuggerCore()->action(UseToolTipsInStackView));
|
menu.addAction(debuggerCore()->action(UseToolTipsInStackView));
|
||||||
#endif
|
#endif
|
||||||
menu.addAction(debuggerCore()->action(UseAddressInStackView));
|
if (engineCapabilities & MemoryAddressCapability)
|
||||||
|
menu.addAction(debuggerCore()->action(UseAddressInStackView));
|
||||||
|
|
||||||
|
menu.addSeparator();
|
||||||
|
|
||||||
addBaseContextActions(&menu);
|
addBaseContextActions(&menu);
|
||||||
|
|
||||||
QAction *act = menu.exec(ev->globalPos());
|
QAction *act = menu.exec(ev->globalPos());
|
||||||
|
if (!act)
|
||||||
|
return;
|
||||||
|
|
||||||
if (act == actCopyContents)
|
if (act == actCopyContents)
|
||||||
copyContentsToClipboard();
|
copyContentsToClipboard();
|
||||||
|
|||||||
Reference in New Issue
Block a user