2022-08-19 15:59:36 +02:00
|
|
|
// Copyright (C) 2016 The Qt Company Ltd.
|
2022-12-21 10:12:09 +01:00
|
|
|
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
|
2009-03-18 10:04:02 +01:00
|
|
|
|
2016-03-18 07:55:01 +01:00
|
|
|
#pragma once
|
2009-03-18 10:04:02 +01:00
|
|
|
|
2023-06-23 08:42:03 +02:00
|
|
|
#include "gdb/gdbsettings.h"
|
2023-05-30 13:17:58 +02:00
|
|
|
|
2019-12-10 08:48:30 +01:00
|
|
|
#include <QCoreApplication>
|
2012-02-15 10:42:41 +01:00
|
|
|
#include <QHash>
|
|
|
|
|
#include <QMap>
|
2014-09-18 14:33:32 +02:00
|
|
|
#include <QVector>
|
2009-03-26 17:27:44 +01:00
|
|
|
|
2022-07-05 15:37:08 +02:00
|
|
|
namespace Debugger::Internal {
|
2009-03-26 15:56:16 +01:00
|
|
|
|
2021-03-05 12:48:26 +01:00
|
|
|
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
|
2018-07-23 22:28:49 +02:00
|
|
|
using SourcePathMap = QMap<QString, QString>;
|
2014-09-11 22:22:51 +03:00
|
|
|
|
2023-06-26 11:02:42 +02:00
|
|
|
class SourcePathMapAspect : public Utils::TypedAspect<SourcePathMap>
|
2011-03-04 16:21:57 +01:00
|
|
|
{
|
|
|
|
|
public:
|
2021-03-05 12:48:26 +01:00
|
|
|
SourcePathMapAspect();
|
|
|
|
|
~SourcePathMapAspect() override;
|
|
|
|
|
|
|
|
|
|
void fromMap(const QVariantMap &map) override;
|
|
|
|
|
void toMap(QVariantMap &map) const override;
|
|
|
|
|
|
2023-05-02 17:20:57 +02:00
|
|
|
void addToLayout(Layouting::LayoutItem &parent) override;
|
2021-03-05 12:48:26 +01:00
|
|
|
|
2023-07-06 09:57:16 +02:00
|
|
|
void readSettings() override;
|
|
|
|
|
void writeSettings() const override;
|
2021-03-05 08:01:17 +01:00
|
|
|
|
2021-03-05 12:48:26 +01:00
|
|
|
private:
|
2023-06-26 11:02:42 +02:00
|
|
|
void guiToInternal() override;
|
|
|
|
|
void internalToGui() override;
|
|
|
|
|
|
2021-03-05 12:48:26 +01:00
|
|
|
SourcePathMapAspectPrivate *d = nullptr;
|
2011-03-04 16:21:57 +01:00
|
|
|
};
|
|
|
|
|
|
2021-03-01 08:59:44 +01:00
|
|
|
class GeneralSettings
|
|
|
|
|
{
|
|
|
|
|
GeneralSettings();
|
|
|
|
|
~GeneralSettings();
|
|
|
|
|
};
|
|
|
|
|
|
2023-05-30 13:17:58 +02:00
|
|
|
class DebuggerSettings : public GdbSettings
|
2009-03-19 09:32:09 +01:00
|
|
|
{
|
|
|
|
|
public:
|
2013-09-04 18:39:43 +02:00
|
|
|
explicit DebuggerSettings();
|
2019-12-10 08:48:30 +01:00
|
|
|
~DebuggerSettings();
|
2009-06-03 13:53:45 +02:00
|
|
|
|
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>
2018-07-31 12:30:48 +02:00
|
|
|
static QString dump();
|
2009-03-19 09:32:09 +01:00
|
|
|
|
2021-03-01 08:59:44 +01:00
|
|
|
// 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;
|
2021-03-09 11:53:09 +01:00
|
|
|
Utils::BoolAspect forceLoggingToConsole;
|
2021-03-01 08:59:44 +01:00
|
|
|
|
2021-03-05 12:48:26 +01:00
|
|
|
SourcePathMapAspect sourcePathMap;
|
|
|
|
|
|
2021-03-01 08:59:44 +01:00
|
|
|
// Page 4: Locals and expressions
|
|
|
|
|
Utils::BoolAspect useDebuggingHelpers;
|
|
|
|
|
Utils::BoolAspect useCodeModel;
|
|
|
|
|
Utils::BoolAspect showThreadNames;
|
2023-05-22 14:41:27 +02:00
|
|
|
Utils::FilePathAspect extraDumperFile; // For loading a file. Recommended.
|
2021-03-01 08:59:44 +01:00
|
|
|
Utils::StringAspect extraDumperCommands; // To modify an existing setup.
|
|
|
|
|
|
|
|
|
|
Utils::BoolAspect showStdNamespace;
|
|
|
|
|
Utils::BoolAspect showQtNamespace;
|
|
|
|
|
Utils::BoolAspect showQObjectNames;
|
|
|
|
|
|
|
|
|
|
// Page 5: CDB
|
|
|
|
|
Utils::StringAspect cdbAdditionalArguments;
|
|
|
|
|
Utils::StringListAspect cdbBreakEvents;
|
|
|
|
|
Utils::BoolAspect cdbBreakOnCrtDbgReport;
|
|
|
|
|
Utils::BoolAspect useCdbConsole;
|
|
|
|
|
Utils::BoolAspect cdbBreakPointCorrection;
|
|
|
|
|
Utils::BoolAspect cdbUsePythonDumper;
|
|
|
|
|
Utils::BoolAspect firstChanceExceptionTaskEntry;
|
|
|
|
|
Utils::BoolAspect secondChanceExceptionTaskEntry;
|
|
|
|
|
Utils::BoolAspect ignoreFirstChanceAccessViolation;
|
|
|
|
|
|
|
|
|
|
Utils::BoolAspect *registerForPostMortem = nullptr;
|
|
|
|
|
|
|
|
|
|
// Page 6: CDB Paths
|
|
|
|
|
Utils::StringListAspect cdbSymbolPaths;
|
|
|
|
|
Utils::StringListAspect cdbSourcePaths;
|
|
|
|
|
|
|
|
|
|
// Without pages
|
|
|
|
|
Utils::BoolAspect alwaysAdjustColumnWidths;
|
|
|
|
|
Utils::BaseAspect settingsDialog;
|
|
|
|
|
Utils::BoolAspect autoQuit;
|
|
|
|
|
Utils::BoolAspect lockView;
|
|
|
|
|
Utils::BoolAspect logTimeStamps;
|
2009-03-18 10:04:02 +01:00
|
|
|
|
2009-04-02 15:06:24 +02:00
|
|
|
// Stack
|
2021-03-01 08:59:44 +01:00
|
|
|
Utils::BaseAspect expandStack;
|
|
|
|
|
Utils::BaseAspect createFullBacktrace;
|
|
|
|
|
Utils::BoolAspect useToolTipsInStackView;
|
2009-04-02 15:06:24 +02:00
|
|
|
|
2009-03-18 10:04:02 +01:00
|
|
|
// Watchers & Locals
|
2021-03-01 08:59:44 +01:00
|
|
|
Utils::BoolAspect autoDerefPointers;
|
|
|
|
|
Utils::IntegerAspect maximalStringLength;
|
|
|
|
|
Utils::IntegerAspect displayStringLimit;
|
2023-02-27 07:18:57 +01:00
|
|
|
Utils::IntegerAspect defaultArraySize;
|
2021-03-01 08:59:44 +01:00
|
|
|
Utils::BoolAspect sortStructMembers;
|
|
|
|
|
Utils::BoolAspect useToolTipsInLocalsView;
|
2009-03-18 10:04:02 +01:00
|
|
|
|
|
|
|
|
// Breakpoints
|
2021-03-01 08:59:44 +01:00
|
|
|
Utils::BoolAspect synchronizeBreakpoints; // ?
|
|
|
|
|
Utils::BoolAspect allPluginBreakpoints;
|
|
|
|
|
Utils::BoolAspect selectedPluginBreakpoints;
|
|
|
|
|
Utils::BoolAspect noPluginBreakpoints;
|
|
|
|
|
Utils::StringAspect selectedPluginBreakpointsPattern;
|
|
|
|
|
Utils::BoolAspect useToolTipsInBreakpointsView;
|
2011-03-16 18:48:14 +01:00
|
|
|
|
2012-04-18 14:20:54 +02:00
|
|
|
// QML Tools
|
2021-03-01 08:59:44 +01:00
|
|
|
Utils::BoolAspect showAppOnTop;
|
|
|
|
|
|
|
|
|
|
Utils::AspectContainer all; // All
|
|
|
|
|
Utils::AspectContainer page1; // General
|
|
|
|
|
Utils::AspectContainer page4; // Locals & Expressions
|
|
|
|
|
Utils::AspectContainer page5; // CDB
|
|
|
|
|
Utils::AspectContainer page6; // CDB Paths
|
|
|
|
|
|
|
|
|
|
void readSettings();
|
|
|
|
|
void writeSettings() const;
|
|
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
DebuggerSettings(const DebuggerSettings &) = delete;
|
|
|
|
|
DebuggerSettings &operator=(const DebuggerSettings &) = delete;
|
2009-03-19 09:32:09 +01:00
|
|
|
};
|
2009-03-18 10:04:02 +01:00
|
|
|
|
2023-07-13 15:23:29 +02:00
|
|
|
DebuggerSettings &settings();
|
2021-03-01 08:59:44 +01:00
|
|
|
|
2022-07-05 15:37:08 +02:00
|
|
|
} // Debugger::Internal
|
2021-03-05 12:48:26 +01:00
|
|
|
|
|
|
|
|
Q_DECLARE_METATYPE(Debugger::Internal::SourcePathMap)
|