Files
qt-creator/src/plugins/debugger/debuggeractions.h

156 lines
4.7 KiB
C
Raw Normal View History

// Copyright (C) 2016 The Qt Company Ltd.
// 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
#pragma once
2009-03-18 10:04:02 +01:00
#include "gdb/gdbsettings.h"
#include <QCoreApplication>
#include <QHash>
#include <QMap>
#include <QVector>
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(const QSettings *settings) override;
void writeSettings(QSettings *settings) const override;
private:
void guiToInternal() override;
void internalToGui() override;
SourcePathMapAspectPrivate *d = nullptr;
};
class GeneralSettings
{
GeneralSettings();
~GeneralSettings();
};
class DebuggerSettings : public GdbSettings
{
public:
explicit DebuggerSettings();
~DebuggerSettings();
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();
// 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;
Utils::BoolAspect showThreadNames;
Utils::FilePathAspect extraDumperFile; // For loading a file. Recommended.
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
// Stack
Utils::BaseAspect expandStack;
Utils::BaseAspect createFullBacktrace;
Utils::BoolAspect useToolTipsInStackView;
2009-03-18 10:04:02 +01:00
// Watchers & Locals
Utils::BoolAspect autoDerefPointers;
Utils::IntegerAspect maximalStringLength;
Utils::IntegerAspect displayStringLimit;
Utils::IntegerAspect defaultArraySize;
Utils::BoolAspect sortStructMembers;
Utils::BoolAspect useToolTipsInLocalsView;
2009-03-18 10:04:02 +01:00
// Breakpoints
Utils::BoolAspect synchronizeBreakpoints; // ?
Utils::BoolAspect allPluginBreakpoints;
Utils::BoolAspect selectedPluginBreakpoints;
Utils::BoolAspect noPluginBreakpoints;
Utils::StringAspect selectedPluginBreakpointsPattern;
Utils::BoolAspect useToolTipsInBreakpointsView;
// QML Tools
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-18 10:04:02 +01:00
DebuggerSettings *debuggerSettings();
} // Debugger::Internal
Q_DECLARE_METATYPE(Debugger::Internal::SourcePathMap)