Debugger: Move CommonOptionsPage to new settings scheme

Change-Id: I851931d3b0536659dc2e53a67b9879caad2f3166
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
hjk
2023-07-18 10:49:35 +02:00
parent 2f11a1d32b
commit 11e1c7b1a4
8 changed files with 252 additions and 236 deletions

View File

@@ -5,56 +5,39 @@
#include <utils/aspects.h>
#include <QCoreApplication>
#include <QHash>
#include <QMap>
namespace Debugger::Internal {
class SourcePathMapAspectPrivate;
// Entries starting with '(' are considered regular expressions in the ElfReader.
// This is useful when there are multiple build machines with different
// path, and the user would like to match anything up to some known
// directory to his local project.
// Syntax: (/home/.*)/KnownSubdir -> /home/my/project
using SourcePathMap = QMap<QString, QString>;
class SourcePathMapAspect : public Utils::TypedAspect<SourcePathMap>
{
public:
SourcePathMapAspect();
~SourcePathMapAspect() override;
void fromMap(const QVariantMap &map) override;
void toMap(QVariantMap &map) const override;
void addToLayout(Layouting::LayoutItem &parent) override;
void readSettings() override;
void writeSettings() const override;
private:
void guiToBuffer() override;
void bufferToGui() override;
SourcePathMapAspectPrivate *d = nullptr;
};
class GeneralSettings
{
GeneralSettings();
~GeneralSettings();
};
class DebuggerSettings
{
public:
explicit DebuggerSettings();
~DebuggerSettings();
DebuggerSettings();
static QString dump();
// Page 1: General
Utils::BoolAspect &useAlternatingRowColors;
Utils::BoolAspect &useAnnotationsInMainEditor;
Utils::BoolAspect &useToolTipsInMainEditor;
Utils::BoolAspect &closeSourceBuffersOnExit;
Utils::BoolAspect &closeMemoryBuffersOnExit;
Utils::BoolAspect &raiseOnInterrupt;
Utils::BoolAspect &breakpointsFullPathByDefault;
Utils::BoolAspect &warnOnReleaseBuilds;
Utils::IntegerAspect &maximalStackDepth;
Utils::BoolAspect &fontSizeFollowsEditor;
Utils::BoolAspect &switchModeOnExit;
Utils::BoolAspect &showQmlObjectTree;
Utils::BoolAspect &stationaryEditorWhileStepping;
Utils::BoolAspect &forceLoggingToConsole;
Utils::TypedAspect<QMap<QString, QString>> &sourcePathMap;
Utils::BoolAspect &registerForPostMortem;
// Page 2: Gdb
Utils::IntegerAspect &gdbWatchdogTimeout;
Utils::BoolAspect &skipKnownFrames;
Utils::BoolAspect &useMessageBoxForSignals;
@@ -78,25 +61,6 @@ public:
Utils::BoolAspect &enableReverseDebugging;
Utils::BoolAspect &multiInferior;
// Page 1: General
Utils::BoolAspect useAlternatingRowColors;
Utils::BoolAspect useAnnotationsInMainEditor;
Utils::BoolAspect useToolTipsInMainEditor;
Utils::BoolAspect closeSourceBuffersOnExit;
Utils::BoolAspect closeMemoryBuffersOnExit;
Utils::BoolAspect raiseOnInterrupt;
Utils::BoolAspect breakpointsFullPathByDefault;
Utils::BoolAspect warnOnReleaseBuilds;
Utils::IntegerAspect maximalStackDepth;
Utils::BoolAspect fontSizeFollowsEditor;
Utils::BoolAspect switchModeOnExit;
Utils::BoolAspect showQmlObjectTree;
Utils::BoolAspect stationaryEditorWhileStepping;
Utils::BoolAspect forceLoggingToConsole;
SourcePathMapAspect sourcePathMap;
// Page 4: Locals and expressions
Utils::BoolAspect useDebuggingHelpers;
Utils::BoolAspect useCodeModel;
@@ -119,8 +83,6 @@ public:
Utils::BoolAspect secondChanceExceptionTaskEntry;
Utils::BoolAspect ignoreFirstChanceAccessViolation;
Utils::BoolAspect *registerForPostMortem = nullptr;
// Page 6: CDB Paths
Utils::StringListAspect cdbSymbolPaths;
Utils::StringListAspect cdbSourcePaths;
@@ -172,6 +134,7 @@ private:
DebuggerSettings &settings();
} // Debugger::Internal
QString msgSetBreakpointAtFunction(const char *function);
QString msgSetBreakpointAtFunctionToolTip(const char *function, const QString &hint = {});
Q_DECLARE_METATYPE(Debugger::Internal::SourcePathMap)
} // Debugger::Internal