forked from qt-creator/qt-creator
debugger: replace static capability check by something potentially dynamic
This does not yet use the potential. Change-Id: I087311fb7d59b46e49f65a84c4420c72a1227ebb Reviewed-by: Aurindam Jana <aurindam.jana@nokia.com>
This commit is contained in:
@@ -683,12 +683,6 @@ QVariant BreakHandler::data(const QModelIndex &mi, int role) const
|
|||||||
if (debuggerCore()->boolSetting(UseToolTipsInBreakpointsView))
|
if (debuggerCore()->boolSetting(UseToolTipsInBreakpointsView))
|
||||||
return QVariant(it->toToolTip());
|
return QVariant(it->toToolTip());
|
||||||
break;
|
break;
|
||||||
case EngineCapabilitiesRole: {
|
|
||||||
const unsigned caps = it.value().engine ?
|
|
||||||
it.value().engine->debuggerCapabilities() :
|
|
||||||
unsigned(AllDebuggerCapabilities);
|
|
||||||
return QVariant(caps);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
return QVariant();
|
return QVariant();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -70,7 +70,7 @@ class BreakpointDialog : public QDialog
|
|||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
explicit BreakpointDialog(unsigned engineCapabilities, QWidget *parent = 0);
|
explicit BreakpointDialog(BreakpointModelId id, QWidget *parent = 0);
|
||||||
bool showDialog(BreakpointParameters *data, BreakpointParts *parts);
|
bool showDialog(BreakpointParameters *data, BreakpointParts *parts);
|
||||||
|
|
||||||
void setParameters(const BreakpointParameters &data);
|
void setParameters(const BreakpointParameters &data);
|
||||||
@@ -95,18 +95,20 @@ private:
|
|||||||
bool m_firstTypeChange;
|
bool m_firstTypeChange;
|
||||||
};
|
};
|
||||||
|
|
||||||
BreakpointDialog::BreakpointDialog(unsigned engineCapabilities, QWidget *parent)
|
BreakpointDialog::BreakpointDialog(BreakpointModelId id, QWidget *parent)
|
||||||
: QDialog(parent), m_enabledParts(-1), m_previousType(UnknownType),
|
: QDialog(parent), m_enabledParts(-1), m_previousType(UnknownType),
|
||||||
m_firstTypeChange(true)
|
m_firstTypeChange(true)
|
||||||
{
|
{
|
||||||
m_ui.setupUi(this);
|
m_ui.setupUi(this);
|
||||||
m_ui.comboBoxType->setMaxVisibleItems(20);
|
m_ui.comboBoxType->setMaxVisibleItems(20);
|
||||||
if (!(engineCapabilities & BreakConditionCapability))
|
if (DebuggerEngine *engine = breakHandler()->engine(id)) {
|
||||||
m_enabledParts &= ~ConditionPart;
|
if (!engine->hasCapability(BreakConditionCapability))
|
||||||
if (!(engineCapabilities & BreakModuleCapability))
|
m_enabledParts &= ~ConditionPart;
|
||||||
m_enabledParts &= ~ModulePart;
|
if (!engine->hasCapability(BreakModuleCapability))
|
||||||
if (!(engineCapabilities & TracePointCapability))
|
m_enabledParts &= ~ModulePart;
|
||||||
m_enabledParts &= ~TracePointPart;
|
if (!engine->hasCapability(TracePointCapability))
|
||||||
|
m_enabledParts &= ~TracePointPart;
|
||||||
|
}
|
||||||
// Match BreakpointType (omitting unknown type).
|
// Match BreakpointType (omitting unknown type).
|
||||||
QStringList types;
|
QStringList types;
|
||||||
types << tr("File name and line number")
|
types << tr("File name and line number")
|
||||||
@@ -123,7 +125,7 @@ BreakpointDialog::BreakpointDialog(unsigned engineCapabilities, QWidget *parent)
|
|||||||
<< tr("Break on QML signal handler")
|
<< tr("Break on QML signal handler")
|
||||||
<< tr("Break when JavaScript exception is thrown");
|
<< tr("Break when JavaScript exception is thrown");
|
||||||
|
|
||||||
QTC_ASSERT(types.size() == BreakpointAtJavaScriptThrow, return; )
|
QTC_ASSERT(types.size() == BreakpointAtJavaScriptThrow, return);
|
||||||
m_ui.comboBoxType->addItems(types);
|
m_ui.comboBoxType->addItems(types);
|
||||||
m_ui.pathChooserFileName->setExpectedKind(Utils::PathChooser::File);
|
m_ui.pathChooserFileName->setExpectedKind(Utils::PathChooser::File);
|
||||||
connect(m_ui.comboBoxType, SIGNAL(activated(int)), SLOT(typeChanged(int)));
|
connect(m_ui.comboBoxType, SIGNAL(activated(int)), SLOT(typeChanged(int)));
|
||||||
@@ -448,7 +450,7 @@ class MultiBreakPointsDialog : public QDialog
|
|||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
MultiBreakPointsDialog(unsigned engineCapabilities, QWidget *parent = 0);
|
MultiBreakPointsDialog(QWidget *parent = 0);
|
||||||
|
|
||||||
QString condition() const { return m_ui.lineEditCondition->text(); }
|
QString condition() const { return m_ui.lineEditCondition->text(); }
|
||||||
int ignoreCount() const { return m_ui.spinBoxIgnoreCount->value(); }
|
int ignoreCount() const { return m_ui.spinBoxIgnoreCount->value(); }
|
||||||
@@ -464,7 +466,7 @@ private:
|
|||||||
Ui::BreakCondition m_ui;
|
Ui::BreakCondition m_ui;
|
||||||
};
|
};
|
||||||
|
|
||||||
MultiBreakPointsDialog::MultiBreakPointsDialog(unsigned engineCapabilities, QWidget *parent) :
|
MultiBreakPointsDialog::MultiBreakPointsDialog(QWidget *parent) :
|
||||||
QDialog(parent)
|
QDialog(parent)
|
||||||
{
|
{
|
||||||
setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint);
|
setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint);
|
||||||
@@ -472,7 +474,7 @@ MultiBreakPointsDialog::MultiBreakPointsDialog(unsigned engineCapabilities, QWid
|
|||||||
setWindowTitle(tr("Edit Breakpoint Properties"));
|
setWindowTitle(tr("Edit Breakpoint Properties"));
|
||||||
m_ui.spinBoxIgnoreCount->setMinimum(0);
|
m_ui.spinBoxIgnoreCount->setMinimum(0);
|
||||||
m_ui.spinBoxIgnoreCount->setMaximum(2147483647);
|
m_ui.spinBoxIgnoreCount->setMaximum(2147483647);
|
||||||
if (!(engineCapabilities & BreakConditionCapability)) {
|
if (!debuggerCore()->currentEngine()->hasCapability(BreakConditionCapability)) {
|
||||||
m_ui.labelCondition->setEnabled(false);
|
m_ui.labelCondition->setEnabled(false);
|
||||||
m_ui.lineEditCondition->setEnabled(false);
|
m_ui.lineEditCondition->setEnabled(false);
|
||||||
}
|
}
|
||||||
@@ -624,7 +626,7 @@ 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));
|
||||||
if (debuggerCore()->currentEngine()->debuggerCapabilities() & MemoryAddressCapability)
|
if (debuggerCore()->currentEngine()->hasCapability(MemoryAddressCapability))
|
||||||
menu.addAction(debuggerCore()->action(UseAddressInBreakpointsView));
|
menu.addAction(debuggerCore()->action(UseAddressInBreakpointsView));
|
||||||
addBaseContextActions(&menu);
|
addBaseContextActions(&menu);
|
||||||
|
|
||||||
@@ -669,11 +671,8 @@ void BreakWindow::deleteBreakpoints(const BreakpointModelIds &ids)
|
|||||||
void BreakWindow::editBreakpoint(BreakpointModelId id, QWidget *parent)
|
void BreakWindow::editBreakpoint(BreakpointModelId id, QWidget *parent)
|
||||||
{
|
{
|
||||||
BreakpointParameters data = breakHandler()->breakpointData(id);
|
BreakpointParameters data = breakHandler()->breakpointData(id);
|
||||||
unsigned engineCapabilities = AllDebuggerCapabilities;
|
|
||||||
if (const DebuggerEngine *engine = breakHandler()->engine(id))
|
|
||||||
engineCapabilities = engine->debuggerCapabilities();
|
|
||||||
BreakpointParts parts = NoParts;
|
BreakpointParts parts = NoParts;
|
||||||
BreakpointDialog dialog(engineCapabilities, parent);
|
BreakpointDialog dialog(id, parent);
|
||||||
if (dialog.showDialog(&data, &parts))
|
if (dialog.showDialog(&data, &parts))
|
||||||
breakHandler()->changeBreakpointData(id, data, parts);
|
breakHandler()->changeBreakpointData(id, data, parts);
|
||||||
}
|
}
|
||||||
@@ -682,7 +681,7 @@ void BreakWindow::addBreakpoint()
|
|||||||
{
|
{
|
||||||
BreakpointParameters data(BreakpointByFileAndLine);
|
BreakpointParameters data(BreakpointByFileAndLine);
|
||||||
BreakpointParts parts = NoParts;
|
BreakpointParts parts = NoParts;
|
||||||
BreakpointDialog dialog(AllDebuggerCapabilities, this);
|
BreakpointDialog dialog(BreakpointModelId(), this);
|
||||||
dialog.setWindowTitle(tr("Add Breakpoint"));
|
dialog.setWindowTitle(tr("Add Breakpoint"));
|
||||||
if (dialog.showDialog(&data, &parts))
|
if (dialog.showDialog(&data, &parts))
|
||||||
breakHandler()->appendBreakpoint(data);
|
breakHandler()->appendBreakpoint(data);
|
||||||
@@ -701,10 +700,7 @@ void BreakWindow::editBreakpoints(const BreakpointModelIds &ids)
|
|||||||
|
|
||||||
// This allows to change properties of multiple breakpoints at a time.
|
// This allows to change properties of multiple breakpoints at a time.
|
||||||
BreakHandler *handler = breakHandler();
|
BreakHandler *handler = breakHandler();
|
||||||
unsigned engineCapabilities = AllDebuggerCapabilities;
|
MultiBreakPointsDialog dialog;
|
||||||
if (const DebuggerEngine *engine = breakHandler()->engine(id))
|
|
||||||
engineCapabilities = engine->debuggerCapabilities();
|
|
||||||
MultiBreakPointsDialog dialog(engineCapabilities);
|
|
||||||
const QString oldCondition = QString::fromLatin1(handler->condition(id));
|
const QString oldCondition = QString::fromLatin1(handler->condition(id));
|
||||||
dialog.setCondition(oldCondition);
|
dialog.setCondition(oldCondition);
|
||||||
const int oldIgnoreCount = handler->ignoreCount(id);
|
const int oldIgnoreCount = handler->ignoreCount(id);
|
||||||
|
|||||||
@@ -161,8 +161,7 @@ enum DebuggerCapabilities
|
|||||||
CatchCapability = 0x200000, //!< fork, vfork, syscall
|
CatchCapability = 0x200000, //!< fork, vfork, syscall
|
||||||
OperateByInstructionCapability = 0x400000,
|
OperateByInstructionCapability = 0x400000,
|
||||||
RunToLineCapability = 0x800000,
|
RunToLineCapability = 0x800000,
|
||||||
MemoryAddressCapability = 0x1000000,
|
MemoryAddressCapability = 0x1000000
|
||||||
AllDebuggerCapabilities = 0xFFFFFFFF
|
|
||||||
};
|
};
|
||||||
|
|
||||||
enum LogChannel
|
enum LogChannel
|
||||||
|
|||||||
@@ -547,9 +547,8 @@ void DebuggerEngine::startDebugger(DebuggerRunControl *runControl)
|
|||||||
if (!d->m_startParameters.environment.size())
|
if (!d->m_startParameters.environment.size())
|
||||||
d->m_startParameters.environment = Utils::Environment();
|
d->m_startParameters.environment = Utils::Environment();
|
||||||
|
|
||||||
const unsigned engineCapabilities = debuggerCapabilities();
|
|
||||||
debuggerCore()->action(OperateByInstruction)
|
debuggerCore()->action(OperateByInstruction)
|
||||||
->setEnabled(engineCapabilities & DisassemblerCapability);
|
->setEnabled(hasCapability(DisassemblerCapability));
|
||||||
|
|
||||||
QTC_ASSERT(state() == DebuggerNotReady || state() == DebuggerFinished,
|
QTC_ASSERT(state() == DebuggerNotReady || state() == DebuggerFinished,
|
||||||
qDebug() << state());
|
qDebug() << state());
|
||||||
@@ -1346,11 +1345,6 @@ void DebuggerEngine::addOptionPages(QList<Core::IOptionsPage*> *) const
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
unsigned DebuggerEngine::debuggerCapabilities() const
|
|
||||||
{
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool DebuggerEngine::isSynchronous() const
|
bool DebuggerEngine::isSynchronous() const
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
|
|||||||
@@ -193,7 +193,7 @@ public:
|
|||||||
|
|
||||||
virtual void setRegisterValue(int regnr, const QString &value);
|
virtual void setRegisterValue(int regnr, const QString &value);
|
||||||
virtual void addOptionPages(QList<Core::IOptionsPage*> *) const;
|
virtual void addOptionPages(QList<Core::IOptionsPage*> *) const;
|
||||||
virtual unsigned debuggerCapabilities() const;
|
virtual bool hasCapability(unsigned cap) const = 0;
|
||||||
|
|
||||||
virtual bool isSynchronous() const;
|
virtual bool isSynchronous() const;
|
||||||
virtual QByteArray qtNamespace() const;
|
virtual QByteArray qtNamespace() const;
|
||||||
|
|||||||
@@ -67,7 +67,6 @@ enum ModelRoles
|
|||||||
DisplaySourceRole = 32, // Qt::UserRole
|
DisplaySourceRole = 32, // Qt::UserRole
|
||||||
|
|
||||||
EngineStateRole,
|
EngineStateRole,
|
||||||
EngineCapabilitiesRole,
|
|
||||||
EngineActionsEnabledRole,
|
EngineActionsEnabledRole,
|
||||||
RequestActivationRole,
|
RequestActivationRole,
|
||||||
RequestContextMenuRole,
|
RequestContextMenuRole,
|
||||||
|
|||||||
@@ -483,12 +483,12 @@ public:
|
|||||||
void runEngine() {}
|
void runEngine() {}
|
||||||
void shutdownEngine() {}
|
void shutdownEngine() {}
|
||||||
void shutdownInferior() {}
|
void shutdownInferior() {}
|
||||||
unsigned debuggerCapabilities() const;
|
bool hasCapability(unsigned cap) const;
|
||||||
bool acceptsBreakpoint(BreakpointModelId) const { return false; }
|
bool acceptsBreakpoint(BreakpointModelId) const { return false; }
|
||||||
bool acceptsDebuggerCommands() const { return false; }
|
bool acceptsDebuggerCommands() const { return false; }
|
||||||
};
|
};
|
||||||
|
|
||||||
unsigned DummyEngine::debuggerCapabilities() const
|
bool DummyEngine::hasCapability(unsigned cap) const
|
||||||
{
|
{
|
||||||
// This can only be a first approximation of what to expect when running.
|
// This can only be a first approximation of what to expect when running.
|
||||||
Project *project = ProjectExplorerPlugin::instance()->currentProject();
|
Project *project = ProjectExplorerPlugin::instance()->currentProject();
|
||||||
@@ -501,13 +501,13 @@ unsigned DummyEngine::debuggerCapabilities() const
|
|||||||
|
|
||||||
// This is a non-started Cdb or Gdb engine:
|
// This is a non-started Cdb or Gdb engine:
|
||||||
if (activeRc->useCppDebugger())
|
if (activeRc->useCppDebugger())
|
||||||
return WatchpointByAddressCapability
|
return cap & (WatchpointByAddressCapability
|
||||||
| BreakConditionCapability
|
| BreakConditionCapability
|
||||||
| TracePointCapability
|
| TracePointCapability
|
||||||
| OperateByInstructionCapability;
|
| OperateByInstructionCapability);
|
||||||
|
|
||||||
// This is a Qml or unknown engine.
|
// This is a Qml or unknown engine.
|
||||||
return AddWatcherCapability;
|
return cap & AddWatcherCapability;
|
||||||
}
|
}
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////
|
||||||
@@ -1955,7 +1955,7 @@ void DebuggerPluginPrivate::requestContextMenu(ITextEditor *editor,
|
|||||||
// Run to, jump to line below in stopped state.
|
// Run to, jump to line below in stopped state.
|
||||||
if (currentEngine()->state() == InferiorStopOk && contextUsable) {
|
if (currentEngine()->state() == InferiorStopOk && contextUsable) {
|
||||||
menu->addSeparator();
|
menu->addSeparator();
|
||||||
if (currentEngine()->debuggerCapabilities() & RunToLineCapability) {
|
if (currentEngine()->hasCapability(RunToLineCapability)) {
|
||||||
const QString runText = args.address
|
const QString runText = args.address
|
||||||
? DebuggerEngine::tr("Run to Address 0x%1").arg(args.address, 0, 16)
|
? DebuggerEngine::tr("Run to Address 0x%1").arg(args.address, 0, 16)
|
||||||
: DebuggerEngine::tr("Run to Line %1").arg(args.lineNumber);
|
: DebuggerEngine::tr("Run to Line %1").arg(args.lineNumber);
|
||||||
@@ -1964,7 +1964,7 @@ void DebuggerPluginPrivate::requestContextMenu(ITextEditor *editor,
|
|||||||
connect(runToLineAction, SIGNAL(triggered()), SLOT(slotRunToLine()));
|
connect(runToLineAction, SIGNAL(triggered()), SLOT(slotRunToLine()));
|
||||||
menu->addAction(runToLineAction);
|
menu->addAction(runToLineAction);
|
||||||
}
|
}
|
||||||
if (currentEngine()->debuggerCapabilities() & JumpToLineCapability) {
|
if (currentEngine()->hasCapability(JumpToLineCapability)) {
|
||||||
const QString jumpText = args.address
|
const QString jumpText = args.address
|
||||||
? DebuggerEngine::tr("Jump to Address 0x%1").arg(args.address, 0, 16)
|
? DebuggerEngine::tr("Jump to Address 0x%1").arg(args.address, 0, 16)
|
||||||
: DebuggerEngine::tr("Jump to Line %1").arg(args.lineNumber);
|
: DebuggerEngine::tr("Jump to Line %1").arg(args.lineNumber);
|
||||||
@@ -2326,8 +2326,7 @@ void DebuggerPluginPrivate::updateState(DebuggerEngine *engine)
|
|||||||
if (stopped)
|
if (stopped)
|
||||||
QApplication::alert(mainWindow(), 3000);
|
QApplication::alert(mainWindow(), 3000);
|
||||||
|
|
||||||
const uint caps = engine->debuggerCapabilities();
|
const bool canReverse = engine->hasCapability(ReverseSteppingCapability)
|
||||||
const bool canReverse = (caps & ReverseSteppingCapability)
|
|
||||||
&& boolSetting(EnableReverseDebugging);
|
&& boolSetting(EnableReverseDebugging);
|
||||||
m_reverseDirectionAction->setEnabled(canReverse);
|
m_reverseDirectionAction->setEnabled(canReverse);
|
||||||
|
|
||||||
@@ -2335,7 +2334,7 @@ void DebuggerPluginPrivate::updateState(DebuggerEngine *engine)
|
|||||||
m_watchAction2->setEnabled(true);
|
m_watchAction2->setEnabled(true);
|
||||||
m_breakAction->setEnabled(true);
|
m_breakAction->setEnabled(true);
|
||||||
|
|
||||||
const bool canOperateByInstruction = (caps & OperateByInstructionCapability)
|
const bool canOperateByInstruction = engine->hasCapability(OperateByInstructionCapability)
|
||||||
&& (stopped || isCore);
|
&& (stopped || isCore);
|
||||||
action(OperateByInstruction)->setEnabled(canOperateByInstruction);
|
action(OperateByInstruction)->setEnabled(canOperateByInstruction);
|
||||||
|
|
||||||
@@ -2348,15 +2347,15 @@ void DebuggerPluginPrivate::updateState(DebuggerEngine *engine)
|
|||||||
m_nextAction->setToolTip(QString());
|
m_nextAction->setToolTip(QString());
|
||||||
|
|
||||||
m_stepOutAction->setEnabled(stopped);
|
m_stepOutAction->setEnabled(stopped);
|
||||||
m_runToLineAction->setEnabled(stopped && (caps & RunToLineCapability));
|
m_runToLineAction->setEnabled(stopped && engine->hasCapability(RunToLineCapability));
|
||||||
m_runToSelectedFunctionAction->setEnabled(stopped);
|
m_runToSelectedFunctionAction->setEnabled(stopped);
|
||||||
m_returnFromFunctionAction->
|
m_returnFromFunctionAction->
|
||||||
setEnabled(stopped && (caps & ReturnFromFunctionCapability));
|
setEnabled(stopped && engine->hasCapability(ReturnFromFunctionCapability));
|
||||||
|
|
||||||
const bool canJump = stopped && (caps & JumpToLineCapability);
|
const bool canJump = stopped && engine->hasCapability(JumpToLineCapability);
|
||||||
m_jumpToLineAction->setEnabled(canJump);
|
m_jumpToLineAction->setEnabled(canJump);
|
||||||
|
|
||||||
const bool canDeref = actionsEnabled && (caps & AutoDerefPointersCapability);
|
const bool canDeref = actionsEnabled && engine->hasCapability(AutoDerefPointersCapability);
|
||||||
action(AutoDerefPointers)->setEnabled(canDeref);
|
action(AutoDerefPointers)->setEnabled(canDeref);
|
||||||
action(AutoDerefPointers)->setEnabled(true);
|
action(AutoDerefPointers)->setEnabled(true);
|
||||||
action(ExpandStack)->setEnabled(actionsEnabled);
|
action(ExpandStack)->setEnabled(actionsEnabled);
|
||||||
|
|||||||
@@ -1969,9 +1969,9 @@ void GdbEngine::setupEngine()
|
|||||||
m_gdbAdapter->startAdapter();
|
m_gdbAdapter->startAdapter();
|
||||||
}
|
}
|
||||||
|
|
||||||
unsigned GdbEngine::debuggerCapabilities() const
|
bool GdbEngine::hasCapability(unsigned cap) const
|
||||||
{
|
{
|
||||||
unsigned caps = ReverseSteppingCapability
|
if (cap & (ReverseSteppingCapability
|
||||||
| AutoDerefPointersCapability
|
| AutoDerefPointersCapability
|
||||||
| DisassemblerCapability
|
| DisassemblerCapability
|
||||||
| RegisterCapability
|
| RegisterCapability
|
||||||
@@ -1992,16 +1992,17 @@ unsigned GdbEngine::debuggerCapabilities() const
|
|||||||
| CatchCapability
|
| CatchCapability
|
||||||
| OperateByInstructionCapability
|
| OperateByInstructionCapability
|
||||||
| RunToLineCapability
|
| RunToLineCapability
|
||||||
| MemoryAddressCapability;
|
| MemoryAddressCapability))
|
||||||
|
return true;
|
||||||
|
|
||||||
if (startParameters().startMode == AttachCore)
|
if (startParameters().startMode == AttachCore)
|
||||||
return caps;
|
return false;
|
||||||
|
|
||||||
// FIXME: Remove in case we have gdb 7.x on Mac.
|
// FIXME: Remove in case we have gdb 7.x on Mac.
|
||||||
if (startParameters().toolChainAbi.os() == Abi::MacOS)
|
if (startParameters().toolChainAbi.os() == Abi::MacOS)
|
||||||
return caps;
|
return false;
|
||||||
|
|
||||||
return caps | SnapshotCapability;
|
return cap == SnapshotCapability;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -238,7 +238,7 @@ private: ////////// General Interface //////////
|
|||||||
virtual void setupInferior();
|
virtual void setupInferior();
|
||||||
virtual void runEngine();
|
virtual void runEngine();
|
||||||
|
|
||||||
virtual unsigned debuggerCapabilities() const;
|
virtual bool hasCapability(unsigned) const;
|
||||||
virtual void detachDebugger();
|
virtual void detachDebugger();
|
||||||
virtual void shutdownEngine();
|
virtual void shutdownEngine();
|
||||||
virtual void shutdownInferior();
|
virtual void shutdownInferior();
|
||||||
|
|||||||
@@ -116,6 +116,7 @@ public:
|
|||||||
void updateWatchData(const WatchData &data,
|
void updateWatchData(const WatchData &data,
|
||||||
const WatchUpdateFlags &flags = WatchUpdateFlags());
|
const WatchUpdateFlags &flags = WatchUpdateFlags());
|
||||||
void fetchFrameSource(qint64 id);
|
void fetchFrameSource(qint64 id);
|
||||||
|
bool hasCapability(unsigned) const { return false; }
|
||||||
|
|
||||||
void rpcCall(Function f, QByteArray payload = QByteArray());
|
void rpcCall(Function f, QByteArray payload = QByteArray());
|
||||||
protected:
|
protected:
|
||||||
|
|||||||
@@ -90,29 +90,26 @@ void ModulesWindow::contextMenuEvent(QContextMenuEvent *ev)
|
|||||||
DebuggerEngine *engine = debuggerCore()->currentEngine();
|
DebuggerEngine *engine = debuggerCore()->currentEngine();
|
||||||
QTC_ASSERT(engine, return);
|
QTC_ASSERT(engine, return);
|
||||||
const bool enabled = engine->debuggerActionsEnabled();
|
const bool enabled = engine->debuggerActionsEnabled();
|
||||||
const unsigned capabilities = engine->debuggerCapabilities();
|
const bool canReload = engine->hasCapability(ReloadModuleCapability);
|
||||||
|
const bool canLoadSymbols = engine->hasCapability(ReloadModuleSymbolsCapability);
|
||||||
|
|
||||||
QMenu menu;
|
QMenu menu;
|
||||||
|
|
||||||
QAction *actUpdateModuleList
|
QAction *actUpdateModuleList
|
||||||
= new QAction(tr("Update Module List"), &menu);
|
= new QAction(tr("Update Module List"), &menu);
|
||||||
actUpdateModuleList
|
actUpdateModuleList->setEnabled(enabled && canReload);
|
||||||
->setEnabled(enabled && (capabilities & ReloadModuleCapability));
|
|
||||||
|
|
||||||
QAction *actShowModuleSources
|
QAction *actShowModuleSources
|
||||||
= new QAction(tr("Show Source Files for Module \"%1\"").arg(name), &menu);
|
= new QAction(tr("Show Source Files for Module \"%1\"").arg(name), &menu);
|
||||||
actShowModuleSources
|
actShowModuleSources->setEnabled(enabled && canReload);
|
||||||
->setEnabled(enabled && (capabilities & ReloadModuleCapability));
|
|
||||||
|
|
||||||
QAction *actLoadSymbolsForAllModules
|
QAction *actLoadSymbolsForAllModules
|
||||||
= new QAction(tr("Load Symbols for All Modules"), &menu);
|
= new QAction(tr("Load Symbols for All Modules"), &menu);
|
||||||
actLoadSymbolsForAllModules
|
actLoadSymbolsForAllModules->setEnabled(enabled && canLoadSymbols);
|
||||||
-> setEnabled(enabled && (capabilities & ReloadModuleSymbolsCapability));
|
|
||||||
|
|
||||||
QAction *actExamineAllModules
|
QAction *actExamineAllModules
|
||||||
= new QAction(tr("Examine All Modules"), &menu);
|
= new QAction(tr("Examine All Modules"), &menu);
|
||||||
actExamineAllModules
|
actExamineAllModules->setEnabled(enabled && canLoadSymbols);
|
||||||
-> setEnabled(enabled && (capabilities & ReloadModuleSymbolsCapability));
|
|
||||||
|
|
||||||
QAction *actLoadSymbolsForModule = 0;
|
QAction *actLoadSymbolsForModule = 0;
|
||||||
QAction *actEditFile = 0;
|
QAction *actEditFile = 0;
|
||||||
@@ -130,14 +127,12 @@ void ModulesWindow::contextMenuEvent(QContextMenuEvent *ev)
|
|||||||
} else {
|
} else {
|
||||||
actLoadSymbolsForModule
|
actLoadSymbolsForModule
|
||||||
= new QAction(tr("Load Symbols for Module \"%1\"").arg(name), &menu);
|
= new QAction(tr("Load Symbols for Module \"%1\"").arg(name), &menu);
|
||||||
actLoadSymbolsForModule
|
actLoadSymbolsForModule->setEnabled(canLoadSymbols);
|
||||||
->setEnabled(capabilities & ReloadModuleSymbolsCapability);
|
|
||||||
actEditFile
|
actEditFile
|
||||||
= new QAction(tr("Edit File \"%1\"").arg(name), &menu);
|
= new QAction(tr("Edit File \"%1\"").arg(name), &menu);
|
||||||
actShowModuleSymbols
|
actShowModuleSymbols
|
||||||
= new QAction(tr("Show Symbols in File \"%1\"").arg(name), &menu);
|
= new QAction(tr("Show Symbols in File \"%1\"").arg(name), &menu);
|
||||||
actShowModuleSymbols
|
actShowModuleSymbols->setEnabled(engine->hasCapability(ShowModuleSymbolsCapability));
|
||||||
->setEnabled(capabilities & ShowModuleSymbolsCapability);
|
|
||||||
actShowDependencies = new QAction(tr("Show Dependencies of \"%1\"").arg(name), &menu);
|
actShowDependencies = new QAction(tr("Show Dependencies of \"%1\"").arg(name), &menu);
|
||||||
actShowDependencies->setEnabled(!fileName.isEmpty());
|
actShowDependencies->setEnabled(!fileName.isEmpty());
|
||||||
#ifndef Q_OS_WIN
|
#ifndef Q_OS_WIN
|
||||||
|
|||||||
@@ -828,9 +828,9 @@ void PdbEngine::handleListLocals(const PdbResponse &response)
|
|||||||
handler->insertBulkData(list);
|
handler->insertBulkData(list);
|
||||||
}
|
}
|
||||||
|
|
||||||
unsigned PdbEngine::debuggerCapabilities() const
|
bool PdbEngine::hasCapability(unsigned cap) const
|
||||||
{
|
{
|
||||||
return ReloadModuleCapability|BreakConditionCapability;
|
return cap & (ReloadModuleCapability|BreakConditionCapability);
|
||||||
}
|
}
|
||||||
|
|
||||||
DebuggerEngine *createPdbEngine(const DebuggerStartParameters &startParameters)
|
DebuggerEngine *createPdbEngine(const DebuggerStartParameters &startParameters)
|
||||||
|
|||||||
@@ -116,7 +116,7 @@ signals:
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
QString errorMessage(QProcess::ProcessError error) const;
|
QString errorMessage(QProcess::ProcessError error) const;
|
||||||
unsigned debuggerCapabilities() const;
|
bool hasCapability(unsigned cap) const;
|
||||||
|
|
||||||
Q_SLOT void handlePdbFinished(int, QProcess::ExitStatus status);
|
Q_SLOT void handlePdbFinished(int, QProcess::ExitStatus status);
|
||||||
Q_SLOT void handlePdbError(QProcess::ProcessError error);
|
Q_SLOT void handlePdbError(QProcess::ProcessError error);
|
||||||
|
|||||||
@@ -250,18 +250,18 @@ void QmlCppEngine::setRegisterValue(int regnr, const QString &value)
|
|||||||
d->m_cppEngine->setRegisterValue(regnr, value);
|
d->m_cppEngine->setRegisterValue(regnr, value);
|
||||||
}
|
}
|
||||||
|
|
||||||
unsigned QmlCppEngine::debuggerCapabilities() const
|
|
||||||
|
bool QmlCppEngine::hasCapability(unsigned cap) const
|
||||||
{
|
{
|
||||||
// ### this could also be an OR of both engines' capabilities
|
// ### this could also be an OR of both engines' capabilities
|
||||||
unsigned result = d->m_cppEngine->debuggerCapabilities();
|
bool hasCap = d->m_cppEngine->hasCapability(cap);
|
||||||
if (d->m_activeEngine != d->m_cppEngine) {
|
if (d->m_activeEngine != d->m_cppEngine) {
|
||||||
const unsigned qmlCapabilities = d->m_qmlEngine->debuggerCapabilities();
|
if (cap == AddWatcherWhileRunningCapability)
|
||||||
if (qmlCapabilities & AddWatcherWhileRunningCapability)
|
hasCap = hasCap || d->m_qmlEngine->hasCapability(cap);
|
||||||
result |= AddWatcherWhileRunningCapability;
|
if (cap == WatchWidgetsCapability)
|
||||||
if (!(qmlCapabilities & WatchWidgetsCapability))
|
hasCap = hasCap && d->m_qmlEngine->hasCapability(cap);
|
||||||
result &= ~WatchWidgetsCapability;
|
|
||||||
}
|
}
|
||||||
return result;
|
return hasCap;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool QmlCppEngine::isSynchronous() const
|
bool QmlCppEngine::isSynchronous() const
|
||||||
|
|||||||
@@ -71,7 +71,7 @@ public:
|
|||||||
void reloadFullStack();
|
void reloadFullStack();
|
||||||
|
|
||||||
void setRegisterValue(int regnr, const QString &value);
|
void setRegisterValue(int regnr, const QString &value);
|
||||||
unsigned debuggerCapabilities() const;
|
bool hasCapability(unsigned cap) const;
|
||||||
|
|
||||||
bool isSynchronous() const;
|
bool isSynchronous() const;
|
||||||
QByteArray qtNamespace() const;
|
QByteArray qtNamespace() const;
|
||||||
|
|||||||
@@ -780,11 +780,11 @@ void QmlEngine::synchronizeWatchers()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
unsigned QmlEngine::debuggerCapabilities() const
|
bool QmlEngine::hasCapability(unsigned cap) const
|
||||||
{
|
{
|
||||||
return AddWatcherCapability
|
return cap & (AddWatcherCapability
|
||||||
| AddWatcherWhileRunningCapability
|
| AddWatcherWhileRunningCapability
|
||||||
| RunToLineCapability;
|
| RunToLineCapability);
|
||||||
/*ReverseSteppingCapability | SnapshotCapability
|
/*ReverseSteppingCapability | SnapshotCapability
|
||||||
| AutoDerefPointersCapability | DisassemblerCapability
|
| AutoDerefPointersCapability | DisassemblerCapability
|
||||||
| RegisterCapability | ShowMemoryCapability
|
| RegisterCapability | ShowMemoryCapability
|
||||||
|
|||||||
@@ -148,7 +148,7 @@ private:
|
|||||||
const WatchUpdateFlags &flags);
|
const WatchUpdateFlags &flags);
|
||||||
void executeDebuggerCommand(const QString &command);
|
void executeDebuggerCommand(const QString &command);
|
||||||
|
|
||||||
unsigned int debuggerCapabilities() const;
|
bool hasCapability(unsigned) const;
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
void tooltipRequested(const QPoint &mousePos,
|
void tooltipRequested(const QPoint &mousePos,
|
||||||
|
|||||||
@@ -179,12 +179,11 @@ void RegisterWindow::contextMenuEvent(QContextMenuEvent *ev)
|
|||||||
DebuggerEngine *engine = currentEngine();
|
DebuggerEngine *engine = currentEngine();
|
||||||
QTC_ASSERT(engine, return);
|
QTC_ASSERT(engine, return);
|
||||||
RegisterHandler *handler = currentHandler();
|
RegisterHandler *handler = currentHandler();
|
||||||
const unsigned engineCapabilities = engine->debuggerCapabilities();
|
|
||||||
const bool actionsEnabled = engine->debuggerActionsEnabled();
|
const bool actionsEnabled = engine->debuggerActionsEnabled();
|
||||||
const int state = engine->state();
|
const int state = engine->state();
|
||||||
|
|
||||||
QAction *actReload = menu.addAction(tr("Reload Register Listing"));
|
QAction *actReload = menu.addAction(tr("Reload Register Listing"));
|
||||||
actReload->setEnabled((engineCapabilities & RegisterCapability)
|
actReload->setEnabled(engine->hasCapability(RegisterCapability)
|
||||||
&& (state == InferiorStopOk || state == InferiorUnrunnable));
|
&& (state == InferiorStopOk || state == InferiorUnrunnable));
|
||||||
|
|
||||||
menu.addSeparator();
|
menu.addSeparator();
|
||||||
@@ -201,17 +200,17 @@ void RegisterWindow::contextMenuEvent(QContextMenuEvent *ev)
|
|||||||
|
|
||||||
QAction *actShowDisassemblerAt = menu.addAction(QString());
|
QAction *actShowDisassemblerAt = menu.addAction(QString());
|
||||||
QAction *actShowDisassembler = menu.addAction(tr("Open Disassembler..."));
|
QAction *actShowDisassembler = menu.addAction(tr("Open Disassembler..."));
|
||||||
actShowDisassembler->setEnabled(engineCapabilities & DisassemblerCapability);
|
actShowDisassembler->setEnabled(engine->hasCapability(DisassemblerCapability));
|
||||||
|
|
||||||
if (address) {
|
if (address) {
|
||||||
const bool canShow = actionsEnabled && (engineCapabilities & ShowMemoryCapability);
|
const bool canShow = actionsEnabled && engine->hasCapability(ShowMemoryCapability);
|
||||||
actEditMemory->setText(tr("Open Memory Editor at 0x%1").arg(address, 0, 16));
|
actEditMemory->setText(tr("Open Memory Editor at 0x%1").arg(address, 0, 16));
|
||||||
actEditMemory->setEnabled(canShow);
|
actEditMemory->setEnabled(canShow);
|
||||||
actViewMemory->setText(tr("Open Memory View at Value of Register %1 0x%2")
|
actViewMemory->setText(tr("Open Memory View at Value of Register %1 0x%2")
|
||||||
.arg(QString::fromAscii(aRegister.name)).arg(address, 0, 16));
|
.arg(QString::fromAscii(aRegister.name)).arg(address, 0, 16));
|
||||||
actShowDisassemblerAt->setText(tr("Open Disassembler at 0x%1")
|
actShowDisassemblerAt->setText(tr("Open Disassembler at 0x%1")
|
||||||
.arg(address, 0, 16));
|
.arg(address, 0, 16));
|
||||||
actShowDisassemblerAt->setEnabled(engineCapabilities & DisassemblerCapability);
|
actShowDisassemblerAt->setEnabled(engine->hasCapability(DisassemblerCapability));
|
||||||
} else {
|
} else {
|
||||||
actEditMemory->setText(tr("Open Memory Editor"));
|
actEditMemory->setText(tr("Open Memory Editor"));
|
||||||
actViewMemory->setText(tr("Open Memory View at Value of Register"));
|
actViewMemory->setText(tr("Open Memory View at Value of Register"));
|
||||||
|
|||||||
@@ -105,11 +105,11 @@ private:
|
|||||||
void reloadSourceFiles() {}
|
void reloadSourceFiles() {}
|
||||||
void reloadFullStack() {}
|
void reloadFullStack() {}
|
||||||
|
|
||||||
bool supportsThreads() const { return true; }
|
|
||||||
bool checkForBreakCondition(bool byFunction);
|
bool checkForBreakCondition(bool byFunction);
|
||||||
void updateWatchData(const WatchData &data, const WatchUpdateFlags &flags);
|
void updateWatchData(const WatchData &data, const WatchUpdateFlags &flags);
|
||||||
void updateLocals();
|
void updateLocals();
|
||||||
void updateSubItem(const WatchData &data);
|
void updateSubItem(const WatchData &data);
|
||||||
|
bool hasCapability(unsigned) const { return false; }
|
||||||
|
|
||||||
private:
|
private:
|
||||||
friend class ScriptAgent;
|
friend class ScriptAgent;
|
||||||
|
|||||||
@@ -162,7 +162,7 @@ QVariant SnapshotHandler::data(const QModelIndex &index, int role) const
|
|||||||
const DebuggerEngine *engine = at(index.row());
|
const DebuggerEngine *engine = at(index.row());
|
||||||
|
|
||||||
if (role == SnapshotCapabilityRole)
|
if (role == SnapshotCapabilityRole)
|
||||||
return engine && (engine->debuggerCapabilities() & SnapshotCapability);
|
return engine && engine->hasCapability(SnapshotCapability);
|
||||||
|
|
||||||
if (!engine)
|
if (!engine)
|
||||||
return QLatin1String("<finished>");
|
return QLatin1String("<finished>");
|
||||||
|
|||||||
@@ -97,7 +97,6 @@ void StackWindow::contextMenuEvent(QContextMenuEvent *ev)
|
|||||||
StackHandler *handler = engine->stackHandler();
|
StackHandler *handler = engine->stackHandler();
|
||||||
const QModelIndex index = indexAt(ev->pos());
|
const QModelIndex index = indexAt(ev->pos());
|
||||||
const int row = index.row();
|
const int row = index.row();
|
||||||
const unsigned engineCapabilities = engine->debuggerCapabilities();
|
|
||||||
StackFrame frame;
|
StackFrame frame;
|
||||||
if (row >= 0 && row < handler->stackSize())
|
if (row >= 0 && row < handler->stackSize())
|
||||||
frame = handler->frameAt(row);
|
frame = handler->frameAt(row);
|
||||||
@@ -109,25 +108,25 @@ void StackWindow::contextMenuEvent(QContextMenuEvent *ev)
|
|||||||
QAction *actCopyContents = menu.addAction(tr("Copy Contents to Clipboard"));
|
QAction *actCopyContents = menu.addAction(tr("Copy Contents to Clipboard"));
|
||||||
actCopyContents->setEnabled(model() != 0);
|
actCopyContents->setEnabled(model() != 0);
|
||||||
|
|
||||||
if (engineCapabilities & CreateFullBacktraceCapability)
|
if (engine->hasCapability(CreateFullBacktraceCapability))
|
||||||
menu.addAction(debuggerCore()->action(CreateFullBacktrace));
|
menu.addAction(debuggerCore()->action(CreateFullBacktrace));
|
||||||
|
|
||||||
QAction *actShowMemory = 0;
|
QAction *actShowMemory = 0;
|
||||||
if (engineCapabilities & ShowMemoryCapability) {
|
if (engine->hasCapability(ShowMemoryCapability)) {
|
||||||
actShowMemory = menu.addAction(QString());
|
actShowMemory = menu.addAction(QString());
|
||||||
if (address == 0) {
|
if (address == 0) {
|
||||||
actShowMemory->setText(tr("Open Memory Editor"));
|
actShowMemory->setText(tr("Open Memory Editor"));
|
||||||
actShowMemory->setEnabled(false);
|
actShowMemory->setEnabled(false);
|
||||||
} else {
|
} else {
|
||||||
actShowMemory->setText(tr("Open Memory Editor at 0x%1").arg(address, 0, 16));
|
actShowMemory->setText(tr("Open Memory Editor at 0x%1").arg(address, 0, 16));
|
||||||
actShowMemory->setEnabled(engineCapabilities & ShowMemoryCapability);
|
actShowMemory->setEnabled(engine->hasCapability(ShowMemoryCapability));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
QAction *actShowDisassemblerAt = 0;
|
QAction *actShowDisassemblerAt = 0;
|
||||||
QAction *actShowDisassembler = 0;
|
QAction *actShowDisassembler = 0;
|
||||||
|
|
||||||
if (engineCapabilities & DisassemblerCapability) {
|
if (engine->hasCapability(DisassemblerCapability)) {
|
||||||
actShowDisassemblerAt = menu.addAction(QString());
|
actShowDisassemblerAt = menu.addAction(QString());
|
||||||
actShowDisassembler = menu.addAction(tr("Open Disassembler..."));
|
actShowDisassembler = menu.addAction(tr("Open Disassembler..."));
|
||||||
if (address == 0) {
|
if (address == 0) {
|
||||||
@@ -140,13 +139,13 @@ void StackWindow::contextMenuEvent(QContextMenuEvent *ev)
|
|||||||
|
|
||||||
|
|
||||||
QAction *actLoadSymbols = 0;
|
QAction *actLoadSymbols = 0;
|
||||||
if (engineCapabilities & ShowModuleSymbolsCapability)
|
if (engine->hasCapability(ShowModuleSymbolsCapability))
|
||||||
actLoadSymbols = menu.addAction(tr("Try to Load Unknown Symbols"));
|
actLoadSymbols = menu.addAction(tr("Try to Load Unknown Symbols"));
|
||||||
|
|
||||||
#if 0 // @TODO: not implemented
|
#if 0 // @TODO: not implemented
|
||||||
menu.addAction(debuggerCore()->action(UseToolTipsInStackView));
|
menu.addAction(debuggerCore()->action(UseToolTipsInStackView));
|
||||||
#endif
|
#endif
|
||||||
if (engineCapabilities & MemoryAddressCapability)
|
if (engine->hasCapability(MemoryAddressCapability))
|
||||||
menu.addAction(debuggerCore()->action(UseAddressInStackView));
|
menu.addAction(debuggerCore()->action(UseAddressInStackView));
|
||||||
|
|
||||||
menu.addSeparator();
|
menu.addSeparator();
|
||||||
|
|||||||
@@ -919,7 +919,7 @@ Qt::ItemFlags WatchModel::flags(const QModelIndex &idx) const
|
|||||||
|
|
||||||
// Disable editing if debuggee is positively running.
|
// Disable editing if debuggee is positively running.
|
||||||
const bool isRunning = engine() && engine()->state() == InferiorRunOk;
|
const bool isRunning = engine() && engine()->state() == InferiorRunOk;
|
||||||
if (isRunning && engine() && !(engine()->debuggerCapabilities() & AddWatcherWhileRunningCapability))
|
if (isRunning && engine() && !engine()->hasCapability(AddWatcherWhileRunningCapability))
|
||||||
return notEditable;
|
return notEditable;
|
||||||
|
|
||||||
const WatchData &data = *watchItem(idx);
|
const WatchData &data = *watchItem(idx);
|
||||||
|
|||||||
@@ -707,19 +707,18 @@ void WatchWindow::contextMenuEvent(QContextMenuEvent *ev)
|
|||||||
}
|
}
|
||||||
|
|
||||||
const bool actionsEnabled = engine->debuggerActionsEnabled();
|
const bool actionsEnabled = engine->debuggerActionsEnabled();
|
||||||
const unsigned engineCapabilities = engine->debuggerCapabilities();
|
const bool canHandleWatches = engine->hasCapability(AddWatcherCapability);
|
||||||
const bool canHandleWatches = engineCapabilities & AddWatcherCapability;
|
|
||||||
const DebuggerState state = engine->state();
|
const DebuggerState state = engine->state();
|
||||||
const bool canInsertWatches = state == InferiorStopOk
|
const bool canInsertWatches = state == InferiorStopOk
|
||||||
|| state == DebuggerNotReady
|
|| state == DebuggerNotReady
|
||||||
|| state == InferiorUnrunnable
|
|| state == InferiorUnrunnable
|
||||||
|| (state == InferiorRunOk && (engineCapabilities & AddWatcherWhileRunningCapability));
|
|| (state == InferiorRunOk && engine->hasCapability(AddWatcherWhileRunningCapability));
|
||||||
|
|
||||||
QMenu breakpointMenu;
|
QMenu breakpointMenu;
|
||||||
breakpointMenu.setTitle(tr("Add Data Breakpoint..."));
|
breakpointMenu.setTitle(tr("Add Data Breakpoint..."));
|
||||||
QAction *actSetWatchpointAtVariableAddress = 0;
|
QAction *actSetWatchpointAtVariableAddress = 0;
|
||||||
QAction *actSetWatchpointAtPointerValue = 0;
|
QAction *actSetWatchpointAtPointerValue = 0;
|
||||||
const bool canSetWatchpoint = engineCapabilities & WatchpointByAddressCapability;
|
const bool canSetWatchpoint = engine->hasCapability(WatchpointByAddressCapability);
|
||||||
if (canSetWatchpoint && address) {
|
if (canSetWatchpoint && address) {
|
||||||
actSetWatchpointAtVariableAddress =
|
actSetWatchpointAtVariableAddress =
|
||||||
new QAction(tr("Add Data Breakpoint at Object's Address (0x%1)")
|
new QAction(tr("Add Data Breakpoint at Object's Address (0x%1)")
|
||||||
@@ -744,7 +743,7 @@ void WatchWindow::contextMenuEvent(QContextMenuEvent *ev)
|
|||||||
"to stop when the data at the address is modified."));
|
"to stop when the data at the address is modified."));
|
||||||
|
|
||||||
QAction *actSetWatchpointAtExpression = 0;
|
QAction *actSetWatchpointAtExpression = 0;
|
||||||
const bool canSetWatchpointAtExpression = engineCapabilities & WatchpointByExpressionCapability;
|
const bool canSetWatchpointAtExpression = engine->hasCapability(WatchpointByExpressionCapability);
|
||||||
if (name.isEmpty() || !canSetWatchpointAtExpression) {
|
if (name.isEmpty() || !canSetWatchpointAtExpression) {
|
||||||
actSetWatchpointAtExpression =
|
actSetWatchpointAtExpression =
|
||||||
new QAction(tr("Add Data Breakpoint at Expression"),
|
new QAction(tr("Add Data Breakpoint at Expression"),
|
||||||
@@ -771,7 +770,7 @@ void WatchWindow::contextMenuEvent(QContextMenuEvent *ev)
|
|||||||
actInsertNewWatchItem->setEnabled(canHandleWatches && canInsertWatches);
|
actInsertNewWatchItem->setEnabled(canHandleWatches && canInsertWatches);
|
||||||
QAction *actSelectWidgetToWatch = menu.addAction(tr("Select Widget to Watch"));
|
QAction *actSelectWidgetToWatch = menu.addAction(tr("Select Widget to Watch"));
|
||||||
actSelectWidgetToWatch->setEnabled(canHandleWatches
|
actSelectWidgetToWatch->setEnabled(canHandleWatches
|
||||||
&& (engine->debuggerCapabilities() & WatchWidgetsCapability));
|
&& engine->hasCapability(WatchWidgetsCapability));
|
||||||
QAction *actEditTypeFormats = menu.addAction(tr("Change Global Display Formats..."));
|
QAction *actEditTypeFormats = menu.addAction(tr("Change Global Display Formats..."));
|
||||||
actEditTypeFormats->setEnabled(true);
|
actEditTypeFormats->setEnabled(true);
|
||||||
menu.addSeparator();
|
menu.addSeparator();
|
||||||
@@ -806,7 +805,7 @@ void WatchWindow::contextMenuEvent(QContextMenuEvent *ev)
|
|||||||
QAction *actOpenMemoryEditorStackLayout = new QAction(&memoryMenu);
|
QAction *actOpenMemoryEditorStackLayout = new QAction(&memoryMenu);
|
||||||
QAction *actOpenMemoryViewAtVariableAddress = new QAction(&memoryMenu);
|
QAction *actOpenMemoryViewAtVariableAddress = new QAction(&memoryMenu);
|
||||||
QAction *actOpenMemoryViewAtPointerValue = new QAction(&memoryMenu);
|
QAction *actOpenMemoryViewAtPointerValue = new QAction(&memoryMenu);
|
||||||
if (engineCapabilities & ShowMemoryCapability) {
|
if (engine->hasCapability(ShowMemoryCapability)) {
|
||||||
actOpenMemoryEditor->setText(tr("Open Memory Editor..."));
|
actOpenMemoryEditor->setText(tr("Open Memory Editor..."));
|
||||||
if (address) {
|
if (address) {
|
||||||
actOpenMemoryEditAtVariableAddress->setText(
|
actOpenMemoryEditAtVariableAddress->setText(
|
||||||
|
|||||||
Reference in New Issue
Block a user