forked from qt-creator/qt-creator
Debugger: Paddle back on multiple inheritance for settings
This is fairly close to the new "standard" pattern for an individual page but still allows flat access using the same 'settings().' stanza. Change-Id: I1edbbd64a857a3d3936fb2c21fdc7e3c8ae7a44c Reviewed-by: Christian Stenger <christian.stenger@qt.io> Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
This commit is contained in:
@@ -7,6 +7,7 @@
|
|||||||
#include "debuggericons.h"
|
#include "debuggericons.h"
|
||||||
#include "debuggerinternalconstants.h"
|
#include "debuggerinternalconstants.h"
|
||||||
#include "debuggertr.h"
|
#include "debuggertr.h"
|
||||||
|
#include "gdb/gdbsettings.h"
|
||||||
|
|
||||||
#ifdef Q_OS_WIN
|
#ifdef Q_OS_WIN
|
||||||
#include "registerpostmortemaction.h"
|
#include "registerpostmortemaction.h"
|
||||||
@@ -39,7 +40,28 @@ DebuggerSettings &settings()
|
|||||||
return settings;
|
return settings;
|
||||||
}
|
}
|
||||||
|
|
||||||
DebuggerSettings::DebuggerSettings()
|
DebuggerSettings::DebuggerSettings() :
|
||||||
|
gdbWatchdogTimeout{gdbSettings().gdbWatchdogTimeout},
|
||||||
|
skipKnownFrames{gdbSettings().skipKnownFrames},
|
||||||
|
useMessageBoxForSignals{gdbSettings().useMessageBoxForSignals},
|
||||||
|
adjustBreakpointLocations{gdbSettings().adjustBreakpointLocations},
|
||||||
|
useDynamicType{gdbSettings().useDynamicType},
|
||||||
|
loadGdbInit{gdbSettings().loadGdbInit},
|
||||||
|
loadGdbDumpers{gdbSettings().loadGdbDumpers},
|
||||||
|
intelFlavor{gdbSettings().intelFlavor},
|
||||||
|
usePseudoTracepoints{gdbSettings().usePseudoTracepoints},
|
||||||
|
useIndexCache{gdbSettings().useIndexCache},
|
||||||
|
gdbStartupCommands{gdbSettings().gdbStartupCommands},
|
||||||
|
gdbPostAttachCommands{gdbSettings().gdbPostAttachCommands},
|
||||||
|
targetAsync{gdbSettings().targetAsync},
|
||||||
|
autoEnrichParameters{gdbSettings().autoEnrichParameters},
|
||||||
|
breakOnThrow{gdbSettings().breakOnThrow},
|
||||||
|
breakOnCatch{gdbSettings().breakOnCatch},
|
||||||
|
breakOnWarning{gdbSettings().breakOnWarning},
|
||||||
|
breakOnFatal{gdbSettings().breakOnFatal},
|
||||||
|
breakOnAbort{gdbSettings().breakOnAbort},
|
||||||
|
enableReverseDebugging{gdbSettings().enableReverseDebugging},
|
||||||
|
multiInferior{gdbSettings().multiInferior}
|
||||||
{
|
{
|
||||||
const QString debugModeGroup(debugModeSettingsGroupC);
|
const QString debugModeGroup(debugModeSettingsGroupC);
|
||||||
const QString cdbSettingsGroup(cdbSettingsGroupC);
|
const QString cdbSettingsGroup(cdbSettingsGroupC);
|
||||||
@@ -467,13 +489,11 @@ DebuggerSettings::~DebuggerSettings()
|
|||||||
void DebuggerSettings::readSettings()
|
void DebuggerSettings::readSettings()
|
||||||
{
|
{
|
||||||
all.readSettings();
|
all.readSettings();
|
||||||
GdbSettings::readSettings();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void DebuggerSettings::writeSettings() const
|
void DebuggerSettings::writeSettings() const
|
||||||
{
|
{
|
||||||
all.writeSettings();
|
all.writeSettings();
|
||||||
GdbSettings::writeSettings();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
QString DebuggerSettings::dump()
|
QString DebuggerSettings::dump()
|
||||||
|
|||||||
@@ -3,12 +3,11 @@
|
|||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include "gdb/gdbsettings.h"
|
#include <utils/aspects.h>
|
||||||
|
|
||||||
#include <QCoreApplication>
|
#include <QCoreApplication>
|
||||||
#include <QHash>
|
#include <QHash>
|
||||||
#include <QMap>
|
#include <QMap>
|
||||||
#include <QVector>
|
|
||||||
|
|
||||||
namespace Debugger::Internal {
|
namespace Debugger::Internal {
|
||||||
|
|
||||||
@@ -48,7 +47,7 @@ class GeneralSettings
|
|||||||
~GeneralSettings();
|
~GeneralSettings();
|
||||||
};
|
};
|
||||||
|
|
||||||
class DebuggerSettings : public GdbSettings
|
class DebuggerSettings
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
explicit DebuggerSettings();
|
explicit DebuggerSettings();
|
||||||
@@ -56,6 +55,29 @@ public:
|
|||||||
|
|
||||||
static QString dump();
|
static QString dump();
|
||||||
|
|
||||||
|
Utils::IntegerAspect &gdbWatchdogTimeout;
|
||||||
|
Utils::BoolAspect &skipKnownFrames;
|
||||||
|
Utils::BoolAspect &useMessageBoxForSignals;
|
||||||
|
Utils::BoolAspect &adjustBreakpointLocations;
|
||||||
|
Utils::BoolAspect &useDynamicType;
|
||||||
|
Utils::BoolAspect &loadGdbInit;
|
||||||
|
Utils::BoolAspect &loadGdbDumpers;
|
||||||
|
Utils::BoolAspect &intelFlavor;
|
||||||
|
Utils::BoolAspect &usePseudoTracepoints;
|
||||||
|
Utils::BoolAspect &useIndexCache;
|
||||||
|
Utils::StringAspect &gdbStartupCommands;
|
||||||
|
Utils::StringAspect &gdbPostAttachCommands;
|
||||||
|
|
||||||
|
Utils::BoolAspect &targetAsync;
|
||||||
|
Utils::BoolAspect &autoEnrichParameters;
|
||||||
|
Utils::BoolAspect &breakOnThrow;
|
||||||
|
Utils::BoolAspect &breakOnCatch;
|
||||||
|
Utils::BoolAspect &breakOnWarning;
|
||||||
|
Utils::BoolAspect &breakOnFatal;
|
||||||
|
Utils::BoolAspect &breakOnAbort;
|
||||||
|
Utils::BoolAspect &enableReverseDebugging;
|
||||||
|
Utils::BoolAspect &multiInferior;
|
||||||
|
|
||||||
// Page 1: General
|
// Page 1: General
|
||||||
Utils::BoolAspect useAlternatingRowColors;
|
Utils::BoolAspect useAlternatingRowColors;
|
||||||
Utils::BoolAspect useAnnotationsInMainEditor;
|
Utils::BoolAspect useAnnotationsInMainEditor;
|
||||||
|
|||||||
@@ -20,12 +20,10 @@
|
|||||||
#include <texteditor/textdocument.h>
|
#include <texteditor/textdocument.h>
|
||||||
#include <texteditor/texteditor.h>
|
#include <texteditor/texteditor.h>
|
||||||
|
|
||||||
#include <utils/aspects.h>
|
|
||||||
#include <utils/mimeutils.h>
|
#include <utils/mimeutils.h>
|
||||||
#include <utils/qtcassert.h>
|
#include <utils/qtcassert.h>
|
||||||
|
|
||||||
#include <QTextBlock>
|
#include <QTextBlock>
|
||||||
#include <QDir>
|
|
||||||
|
|
||||||
using namespace Core;
|
using namespace Core;
|
||||||
using namespace TextEditor;
|
using namespace TextEditor;
|
||||||
|
|||||||
@@ -3,6 +3,8 @@
|
|||||||
|
|
||||||
#include "gdbsettings.h"
|
#include "gdbsettings.h"
|
||||||
|
|
||||||
|
#include <coreplugin/dialogs/ioptionspage.h>
|
||||||
|
|
||||||
#include <debugger/commonoptionspage.h>
|
#include <debugger/commonoptionspage.h>
|
||||||
#include <debugger/debuggeractions.h>
|
#include <debugger/debuggeractions.h>
|
||||||
#include <debugger/debuggerconstants.h>
|
#include <debugger/debuggerconstants.h>
|
||||||
@@ -18,11 +20,15 @@ using namespace Utils;
|
|||||||
|
|
||||||
namespace Debugger::Internal {
|
namespace Debugger::Internal {
|
||||||
|
|
||||||
|
GdbSettings &gdbSettings()
|
||||||
|
{
|
||||||
|
static GdbSettings settings;
|
||||||
|
return settings;
|
||||||
|
}
|
||||||
|
|
||||||
GdbSettings::GdbSettings()
|
GdbSettings::GdbSettings()
|
||||||
{
|
{
|
||||||
setId("M.Gdb");
|
setAutoApply(false);
|
||||||
setDisplayName(Tr::tr("GDB"));
|
|
||||||
setCategory(Constants::DEBUGGER_SETTINGS_CATEGORY);
|
|
||||||
setSettingsGroup("DebugMode");
|
setSettingsGroup("DebugMode");
|
||||||
|
|
||||||
useMessageBoxForSignals.setSettingsKey("UseMessageBoxForSignals");
|
useMessageBoxForSignals.setSettingsKey("UseMessageBoxForSignals");
|
||||||
@@ -250,4 +256,20 @@ GdbSettings::GdbSettings()
|
|||||||
readSettings();
|
readSettings();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// GdbSettingsPage
|
||||||
|
|
||||||
|
class GdbSettingsPage final : public Core::IOptionsPage
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
GdbSettingsPage()
|
||||||
|
{
|
||||||
|
setId("M.Gdb");
|
||||||
|
setDisplayName(Tr::tr("GDB"));
|
||||||
|
setCategory(Constants::DEBUGGER_SETTINGS_CATEGORY);
|
||||||
|
setSettingsProvider([] { return &gdbSettings(); });
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
const GdbSettingsPage settingsPage;
|
||||||
|
|
||||||
} // Debugger::Internal
|
} // Debugger::Internal
|
||||||
|
|||||||
@@ -3,11 +3,11 @@
|
|||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <coreplugin/dialogs/ioptionspage.h>
|
#include <utils/aspects.h>
|
||||||
|
|
||||||
namespace Debugger::Internal {
|
namespace Debugger::Internal {
|
||||||
|
|
||||||
class GdbSettings : public Core::PagedSettings
|
class GdbSettings : public Utils::AspectContainer
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
GdbSettings();
|
GdbSettings();
|
||||||
@@ -36,4 +36,6 @@ public:
|
|||||||
Utils::BoolAspect multiInferior{this};
|
Utils::BoolAspect multiInferior{this};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
GdbSettings &gdbSettings();
|
||||||
|
|
||||||
} // Debugger::Internal
|
} // Debugger::Internal
|
||||||
|
|||||||
@@ -36,7 +36,6 @@
|
|||||||
#include <QApplication>
|
#include <QApplication>
|
||||||
#include <QDateTime>
|
#include <QDateTime>
|
||||||
#include <QDebug>
|
#include <QDebug>
|
||||||
#include <QDir>
|
|
||||||
#include <QFileInfo>
|
#include <QFileInfo>
|
||||||
#include <QTimer>
|
#include <QTimer>
|
||||||
#include <QToolTip>
|
#include <QToolTip>
|
||||||
|
|||||||
Reference in New Issue
Block a user