aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/debugger/gdb/gdboptionspage.cpp
blob: d41f1b375520b94feb82bcd3106af3109df63c97 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
// Copyright (C) 2016 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0+ OR GPL-3.0 WITH Qt-GPL-exception-1.0

#include <debugger/debuggeractions.h>
#include <debugger/debuggerconstants.h>
#include <debugger/debuggercore.h>
#include <debugger/debuggerinternalconstants.h>
#include <debugger/debuggertr.h>

#include <coreplugin/dialogs/ioptionspage.h>

#include <utils/layoutbuilder.h>

using namespace Core;
using namespace Utils;

namespace Debugger::Internal {

/////////////////////////////////////////////////////////////////////////
//
// GdbOptionsPage - harmless options
//
/////////////////////////////////////////////////////////////////////////

class GdbOptionsPage : public Core::IOptionsPage
{
public:
    GdbOptionsPage()
    {
        setId("M.Gdb");
        setDisplayName(Tr::tr("GDB"));
        setCategory(Constants::DEBUGGER_SETTINGS_CATEGORY);
        setSettings(&debuggerSettings()->page2);

        setLayouter([](QWidget *w) {
            using namespace Layouting;
            DebuggerSettings &s = *debuggerSettings();

            Group general {
                title(Tr::tr("General")),
                Column {
                    Row { s.gdbWatchdogTimeout, st },
                    s.skipKnownFrames,
                    s.useMessageBoxForSignals,
                    s.adjustBreakpointLocations,
                    s.useDynamicType,
                    s.loadGdbInit,
                    s.loadGdbDumpers,
                    s.intelFlavor,
                    s.usePseudoTracepoints,
                    s.useIndexCache,
                    st
                 }
            };

            Column commands {
                Group {
                    title(Tr::tr("Additional Startup Commands")),
                    Column { s.gdbStartupCommands }
                },
                Group {
                    title(Tr::tr("Additional Attach Commands")),
                    Column { s.gdbPostAttachCommands },
                },
                st
            };

            Row { general, commands }.attachTo(w);
        });
    }
};

/////////////////////////////////////////////////////////////////////////
//
// GdbOptionsPage2 - dangerous options
//
/////////////////////////////////////////////////////////////////////////

// The "Dangerous" options.
class GdbOptionsPage2 : public Core::IOptionsPage
{
public:
    GdbOptionsPage2()
    {
        setId("M.Gdb2");
        setDisplayName(Tr::tr("GDB Extended"));
        setCategory(Constants::DEBUGGER_SETTINGS_CATEGORY);
        setSettings(&debuggerSettings()->page3);

        setLayouter([](QWidget *w) {
            auto labelDangerous = new QLabel("<html><head/><body><i>" +
                Tr::tr("The options below give access to advanced "
                "or experimental functions of GDB.<br>Enabling them may negatively "
                "impact your debugging experience.") + "</i></body></html>");

            using namespace Layouting;
            DebuggerSettings &s = *debuggerSettings();

            Group extended {
                title(Tr::tr("Extended")),
                Column {
                    labelDangerous,
                    s.targetAsync,
                    s.autoEnrichParameters,
                    s.breakOnWarning,
                    s.breakOnFatal,
                    s.breakOnAbort,
                    s.enableReverseDebugging,
                    s.multiInferior,
                }
            };

            Column { extended, st }.attachTo(w);
        });
    }
};

// Registration

void addGdbOptionPages(QList<IOptionsPage *> *opts)
{
    opts->push_back(new GdbOptionsPage);
    opts->push_back(new GdbOptionsPage2);
}

} // Debugger::Internal