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:
hjk
2018-07-31 12:30:48 +02:00
parent d6911fd10c
commit 3b5ecac238
58 changed files with 6543 additions and 6100 deletions

View File

@@ -40,6 +40,8 @@ namespace Utils { class FancyLineEdit; }
namespace Debugger {
namespace Internal {
class DebuggerEngine;
class DebuggerPane;
class CombinedPane;
class InputPane;
@@ -48,7 +50,10 @@ class LogWindow : public QWidget
Q_OBJECT
public:
explicit LogWindow(QWidget *parent = nullptr);
explicit LogWindow(DebuggerEngine *engine);
~LogWindow() final;
DebuggerEngine *engine() const;
void setCursor(const QCursor &cursor);
@@ -59,11 +64,6 @@ public:
static QString logTimeStamp();
static bool writeLogContents(const QPlainTextEdit *editor, QWidget *parent = nullptr);
static QChar charForChannel(int channel);
static LogChannel channelForChar(QChar c);
void clearContents();
void sendCommand();
void executeLine();
@@ -73,7 +73,6 @@ public:
void repeatLastCommand();
signals:
void showPage();
void statusMessageRequested(const QString &msg, int);
private:
@@ -83,6 +82,27 @@ private:
QString m_queuedOutput;
Utils::FancyLineEdit *m_commandEdit;
bool m_ignoreNextInputEcho;
DebuggerEngine *m_engine;
};
class GlobalLogWindow : public QWidget
{
Q_OBJECT
public:
explicit GlobalLogWindow();
~GlobalLogWindow() final;
void setCursor(const QCursor &cursor);
void clearUndoRedoStacks();
void clearContents();
void doInput(const QString &input);
void doOutput(const QString &output);
private:
DebuggerPane *m_rightPane; // everything
DebuggerPane *m_leftPane; // combined input
};
} // namespace Internal