diff options
author | hjk <hjk@qt.io> | 2018-07-31 12:30:48 +0200 |
---|---|---|
committer | hjk <hjk@qt.io> | 2018-08-17 12:35:15 +0000 |
commit | 3b5ecac238b87615b44b27375cef0b4f1d4637e4 (patch) | |
tree | 7ef6ab68b1d92564bfdd7181e4cd6c14130a544c /src/plugins/debugger/cdb/cdbengine.h | |
parent | d6911fd10c0d16740e267147bb829ac0aa1b7413 (diff) | |
download | qt-creator-3b5ecac238b87615b44b27375cef0b4f1d4637e4.tar.gz |
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 <christian.stenger@qt.io>
Reviewed-by: hjk <hjk@qt.io>
Diffstat (limited to 'src/plugins/debugger/cdb/cdbengine.h')
-rw-r--r-- | src/plugins/debugger/cdb/cdbengine.h | 26 |
1 files changed, 11 insertions, 15 deletions
diff --git a/src/plugins/debugger/cdb/cdbengine.h b/src/plugins/debugger/cdb/cdbengine.h index 2ef4c3c876..cfc822c658 100644 --- a/src/plugins/debugger/cdb/cdbengine.h +++ b/src/plugins/debugger/cdb/cdbengine.h @@ -52,12 +52,8 @@ public: explicit CdbEngine(); ~CdbEngine() override; - // Factory function that returns 0 if the debug engine library cannot be found. - bool canHandleToolTip(const DebuggerToolTipContext &context) const override; - DebuggerEngine *cppEngine() override { return this; } - void setupEngine() override; void runEngine() override; void shutdownInferior() override; @@ -81,14 +77,18 @@ public: void executeRunToFunction(const QString &functionName) override; void executeJumpToLine(const ContextData &data) override; void assignValueInDebugger(WatchItem *w, const QString &expr, const QVariant &value) override; - void executeDebuggerCommand(const QString &command, DebuggerLanguages languages) override; + void executeDebuggerCommand(const QString &command) override; void activateFrame(int index) override; void selectThread(ThreadId threadId) override; bool stateAcceptsBreakpointChanges() const override; - bool acceptsBreakpoint(Breakpoint bp) const override; - void attemptBreakpointSynchronization() override; + bool acceptsBreakpoint(const BreakpointParameters ¶ms) const override; + + void insertBreakpoint(const Breakpoint &bp) override; + void removeBreakpoint(const Breakpoint &bp) override; + void updateBreakpoint(const Breakpoint &bp) override; + void enableSubBreakpoint(const SubBreakpoint &sbp, bool on) override; void fetchDisassembler(DisassemblerAgent *agent) override; void fetchMemory(MemoryAgent *, quint64 addr, quint64 length) override; @@ -119,8 +119,7 @@ private: void handleDoInterruptInferior(const QString &errorMessage); - using PendingBreakPointMap = QHash<BreakpointModelId, BreakpointResponse>; - using SourcePathMapping = QPair<QString, QString>; + typedef QPair<QString, QString> SourcePathMapping; struct NormalizedSourceFileName // Struct for caching mapped/normalized source files. { NormalizedSourceFileName(const QString &fn = QString(), bool e = false) : fileName(fn), exists(e) {} @@ -176,10 +175,10 @@ private: void handleStackTrace(const DebuggerResponse &); void handleRegisters(const DebuggerResponse &); void handleJumpToLineAddressResolution(const DebuggerResponse &response, const ContextData &context); - void handleExpression(const DebuggerResponse &command, BreakpointModelId id, const GdbMi &stopReason); + void handleExpression(const DebuggerResponse &command, const Breakpoint &bp, const GdbMi &stopReason); void handleResolveSymbol(const DebuggerResponse &command, const QString &symbol, DisassemblerAgent *agent); void handleResolveSymbolHelper(const QList<quint64> &addresses, DisassemblerAgent *agent); - void handleBreakInsert(const DebuggerResponse &response, const BreakpointModelId &bpId); + void handleBreakInsert(const DebuggerResponse &response, const Breakpoint &bp); void handleCheckWow64(const DebuggerResponse &response, const GdbMi &stack); void ensureUsing32BitStackInWow64(const DebuggerResponse &response, const GdbMi &stack); void handleSwitchWow64Stack(const DebuggerResponse &response); @@ -232,11 +231,8 @@ private: bool m_sourceStepInto = false; int m_watchPointX = 0; int m_watchPointY = 0; - PendingBreakPointMap m_pendingBreakpointMap; - PendingBreakPointMap m_insertSubBreakpointMap; - PendingBreakPointMap m_pendingSubBreakpointMap; + QSet<Breakpoint> m_pendingBreakpointMap; bool m_autoBreakPointCorrection = false; - QHash<QString, QString> m_fileNameModuleHash; QMultiHash<QString, quint64> m_symbolAddressCache; bool m_ignoreCdbOutput = false; QList<InterruptCallback> m_interrupCallbacks; |