Commit 7ef450af authored by hjk's avatar hjk Committed by hjk

debugger: better guess at engine capabilities in dummy engine

Change-Id: Ia37086a126df7f7d84b9509c54472c5d9be6b4ef
Reviewed-by: default avatarhjk <qthjk@ovi.com>
parent 8e1f24a6
......@@ -485,11 +485,33 @@ public:
void runEngine() {}
void shutdownEngine() {}
void shutdownInferior() {}
unsigned debuggerCapabilities() const { return AddWatcherCapability; }
unsigned debuggerCapabilities() const;
bool acceptsBreakpoint(BreakpointModelId) const { return false; }
bool acceptsDebuggerCommands() const { return false; }
};
unsigned DummyEngine::debuggerCapabilities() const
{
// This can only be a first approximation of what to expect when running.
Project *project = ProjectExplorerPlugin::instance()->currentProject();
if (!project)
return 0;
Target *target = project->activeTarget();
QTC_ASSERT(target, return 0);
RunConfiguration *activeRc = target->activeRunConfiguration();
QTC_ASSERT(activeRc, return 0);
// This is a non-started Cdb or Gdb engine:
if (activeRc->useCppDebugger())
return WatchpointByAddressCapability
| BreakConditionCapability
| TracePointCapability
| OperateByInstructionCapability;
// This is a Qml or unknown engine.
return AddWatcherCapability;
}
///////////////////////////////////////////////////////////////////////
//
// DebugMode
......
......@@ -711,6 +711,7 @@ void WatchWindow::contextMenuEvent(QContextMenuEvent *ev)
const bool canHandleWatches = engineCapabilities & AddWatcherCapability;
const DebuggerState state = engine->state();
const bool canInsertWatches = state == InferiorStopOk
|| state == DebuggerNotReady
|| state == InferiorUnrunnable
|| (state == InferiorRunOk && (engineCapabilities & AddWatcherWhileRunningCapability));
......
Markdown is supported
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