forked from qt-creator/qt-creator
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>
This commit is contained in:
File diff suppressed because it is too large
Load Diff
@@ -47,7 +47,6 @@ namespace Debugger {
|
||||
namespace Internal {
|
||||
|
||||
class BreakpointParameters;
|
||||
class BreakpointResponse;
|
||||
class DebugInfoTask;
|
||||
class DebugInfoTaskHandler;
|
||||
class DebuggerResponse;
|
||||
@@ -65,7 +64,7 @@ struct CoreInfo
|
||||
const QString &coreFile);
|
||||
};
|
||||
|
||||
class GdbEngine : public DebuggerEngine
|
||||
class GdbEngine : public CppDebuggerEngine
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
@@ -74,8 +73,6 @@ public:
|
||||
~GdbEngine() final;
|
||||
|
||||
private: ////////// General Interface //////////
|
||||
DebuggerEngine *cppEngine() final { return this; }
|
||||
|
||||
void handleGdbStartFailed();
|
||||
void prepareForRestart() final;
|
||||
|
||||
@@ -86,7 +83,7 @@ private: ////////// General Interface //////////
|
||||
void resetInferior() final;
|
||||
|
||||
bool acceptsDebuggerCommands() const final;
|
||||
void executeDebuggerCommand(const QString &command, DebuggerLanguages languages) final;
|
||||
void executeDebuggerCommand(const QString &command) final;
|
||||
|
||||
////////// General State //////////
|
||||
|
||||
@@ -189,11 +186,11 @@ private: ////////// General Interface //////////
|
||||
|
||||
// This should be always the last call in a function.
|
||||
bool stateAcceptsBreakpointChanges() const final;
|
||||
bool acceptsBreakpoint(Breakpoint bp) const final;
|
||||
void insertBreakpoint(Breakpoint bp) final;
|
||||
void removeBreakpoint(Breakpoint bp) final;
|
||||
void changeBreakpoint(Breakpoint bp) final;
|
||||
void enableSubBreakpoint(const QString &locId, bool on) final;
|
||||
bool acceptsBreakpoint(const BreakpointParameters &bp) const final;
|
||||
void insertBreakpoint(const Breakpoint &bp) final;
|
||||
void removeBreakpoint(const Breakpoint &bp) final;
|
||||
void updateBreakpoint(const Breakpoint &bp) final;
|
||||
void enableSubBreakpoint(const SubBreakpoint &sbp, bool on) final;
|
||||
|
||||
void executeStep() final;
|
||||
void executeStepOut() final;
|
||||
@@ -209,6 +206,7 @@ private: ////////// General Interface //////////
|
||||
void executeRunToFunction(const QString &functionName) final;
|
||||
void executeJumpToLine(const ContextData &data) final;
|
||||
void executeReturn() final;
|
||||
void executeRecordReverse(bool reverse);
|
||||
|
||||
void handleExecuteContinue(const DebuggerResponse &response);
|
||||
void handleExecuteStep(const DebuggerResponse &response);
|
||||
@@ -223,26 +221,24 @@ private: ////////// General Interface //////////
|
||||
|
||||
void selectThread(ThreadId threadId) final;
|
||||
void activateFrame(int index) final;
|
||||
void handleAutoContinueInferior();
|
||||
|
||||
//
|
||||
// Breakpoint specific stuff
|
||||
//
|
||||
void handleBreakModifications(const GdbMi &bkpts);
|
||||
void handleBreakIgnore(const DebuggerResponse &response, Breakpoint bp);
|
||||
void handleBreakDisable(const DebuggerResponse &response, Breakpoint bp);
|
||||
void handleBreakEnable(const DebuggerResponse &response, Breakpoint bp);
|
||||
void handleBreakInsert1(const DebuggerResponse &response, Breakpoint bp);
|
||||
void handleBreakInsert2(const DebuggerResponse &response, Breakpoint bp);
|
||||
void handleBreakCondition(const DebuggerResponse &response, Breakpoint bp);
|
||||
void handleBreakThreadSpec(const DebuggerResponse &response, Breakpoint bp);
|
||||
void handleBreakLineNumber(const DebuggerResponse &response, Breakpoint bp);
|
||||
void handleInsertInterpreterBreakpoint(const DebuggerResponse &response, Breakpoint bp);
|
||||
void handleBreakIgnore(const DebuggerResponse &response, const Breakpoint &bp);
|
||||
void handleBreakDisable(const DebuggerResponse &response, const Breakpoint &bp);
|
||||
void handleBreakEnable(const DebuggerResponse &response, const Breakpoint &bp);
|
||||
void handleBreakInsert1(const DebuggerResponse &response, const Breakpoint &bp);
|
||||
void handleBreakInsert2(const DebuggerResponse &response, const Breakpoint &bp);
|
||||
void handleBreakCondition(const DebuggerResponse &response, const Breakpoint &bp);
|
||||
void handleBreakThreadSpec(const DebuggerResponse &response, const Breakpoint &bp);
|
||||
void handleBreakLineNumber(const DebuggerResponse &response, const Breakpoint &bp);
|
||||
void handleInsertInterpreterBreakpoint(const DebuggerResponse &response, const Breakpoint &bp);
|
||||
void handleInterpreterBreakpointModified(const GdbMi &data);
|
||||
void handleWatchInsert(const DebuggerResponse &response, Breakpoint bp);
|
||||
void handleCatchInsert(const DebuggerResponse &response, Breakpoint bp);
|
||||
void handleBkpt(const GdbMi &bkpt, Breakpoint bp);
|
||||
void updateResponse(BreakpointResponse &response, const GdbMi &bkpt);
|
||||
void handleWatchInsert(const DebuggerResponse &response, const Breakpoint &bp);
|
||||
void handleCatchInsert(const DebuggerResponse &response, const Breakpoint &bp);
|
||||
void handleBkpt(const GdbMi &bkpt, const Breakpoint &bp);
|
||||
QString breakpointLocation(const BreakpointParameters &data); // For gdb/MI.
|
||||
QString breakpointLocation2(const BreakpointParameters &data); // For gdb/CLI fallback.
|
||||
QString breakLocation(const QString &file) const;
|
||||
|
||||
Reference in New Issue
Block a user