diff options
author | hjk <[email protected]> | 2018-07-31 12:30:48 +0200 |
---|---|---|
committer | hjk <[email protected]> | 2018-08-17 12:35:15 +0000 |
commit | 3b5ecac238b87615b44b27375cef0b4f1d4637e4 (patch) | |
tree | 7ef6ab68b1d92564bfdd7181e4cd6c14130a544c /src/plugins/debugger/watchhandler.cpp | |
parent | d6911fd10c0d16740e267147bb829ac0aa1b7413 (diff) |
Debugger: Make most views per-engine instead of singletons
This is a step towards properly supporting multiple debugger
sessions side-by-side.
The combined C++-and-QML engine has been removed, instead a
combined setup creates now two individual engines, under a single
DebuggerRunTool but mostly independent with no combined state
machine. This requires a few more clicks in some cases, but
makes it easier to direct e.g. interrupt requests to the
interesting engine.
Care has been taken to not change the UX of the single debugger
session use case if possible. The fat debug button operates
as-before in that case, i.e. switches to Interrupt if the
single active runconfiguration runs in the debugger etc.
Most views are made per-engine, running an engine creates
a new Perspective, which is destroyed when the run control dies.
The snapshot view remains global and becomes primary source
of information on a "current engine" that receives all menu
and otherwise global input.
There is a new global "Breakpoint Preset" view containing
all "static" breakpoint data. When an engine starts up it
"claims" breakpoint it believes it can handle, but operates
on a copy of the static data. The markers of the static
version are suppressed as long as an engine controls a
breakpoint (that inclusive all resolved locations), but are
re-instatet once the engine quits.
The old Breakpoint class that already contained this split
per-instance was split into a new Breakpoint and a
GlobalBreakpoint class, with a per-engine model for Breakpoints,
and a singleton model containing GlobalBreakpoints.
There is a new CppDebuggerEngine intermediate level serving as
base for C++ (or, rather, "compiled") binary debugging, i.e.
{Gdb,Lldb,Cdb}Engine, taking over bits of the current DebuggerEngine
base that are not applicable to non-binary debuggers.
Change-Id: I9994f4c188379b4aee0c4f379edd4759fbb0bd43
Reviewed-by: Christian Stenger <[email protected]>
Reviewed-by: hjk <[email protected]>
Diffstat (limited to 'src/plugins/debugger/watchhandler.cpp')
-rw-r--r-- | src/plugins/debugger/watchhandler.cpp | 21 |
1 files changed, 17 insertions, 4 deletions
diff --git a/src/plugins/debugger/watchhandler.cpp b/src/plugins/debugger/watchhandler.cpp index 3b72e428d89..6bd122e9aed 100644 --- a/src/plugins/debugger/watchhandler.cpp +++ b/src/plugins/debugger/watchhandler.cpp @@ -1298,7 +1298,7 @@ void WatchModel::timerEvent(QTimerEvent *event) } ungrabWidget(); } - showMessage(msg, StatusBar); + m_engine->showMessage(msg, StatusBar); } else { WatchModelBase::timerEvent(event); } @@ -1951,8 +1951,10 @@ QString WatchModel::nameForFormat(int format) /////////////////////////////////////////////////////////////////////// WatchHandler::WatchHandler(DebuggerEngine *engine) + : m_engine(engine) { m_model = new WatchModel(this, engine); + loadSessionDataForEngine(); } WatchHandler::~WatchHandler() @@ -2072,7 +2074,13 @@ void WatchHandler::resetValueCache() void WatchHandler::resetWatchers() { - loadSessionData(); + loadFormats(); + theWatcherNames.clear(); + theWatcherCount = 0; + const QStringList watchers = sessionValue("Watchers").toStringList(); + m_model->m_watchRoot->removeChildren(); + for (const QString &exp : watchers) + watchExpression(exp.trimmed()); } void WatchHandler::notifyUpdateStarted(const UpdateParameters &updateParameters) @@ -2173,7 +2181,7 @@ void WatchHandler::watchExpression(const QString &exp, const QString &name, bool m_model->m_engine->updateWatchData(item->iname); } updateLocalsWindow(); - Internal::raiseWatchersWindow(); + m_engine->raiseWatchersWindow(); } void WatchHandler::updateWatchExpression(WatchItem *item, const QString &newExp) @@ -2358,7 +2366,7 @@ void WatchHandler::updateLocalsWindow() { // Force show/hide of return view. bool showReturn = m_model->m_returnRoot->childCount() != 0; - Internal::updateLocalsWindow(showReturn); + m_engine->updateLocalsWindow(showReturn); } QStringList WatchHandler::watchedExpressions() @@ -2383,6 +2391,11 @@ void WatchHandler::saveSessionData() void WatchHandler::loadSessionData() { + // Handled by loadSesseionDataForEngine. +} + +void WatchHandler::loadSessionDataForEngine() +{ loadFormats(); theWatcherNames.clear(); theWatcherCount = 0; |