1 /****************************************************************************
2 **
3 ** Copyright (C) 2016 The Qt Company Ltd.
4 ** Contact: https://www.qt.io/licensing/
5 **
6 ** This file is part of Qt Creator.
7 **
8 ** Commercial License Usage
9 ** Licensees holding valid commercial Qt licenses may use this file in
10 ** accordance with the commercial license agreement provided with the
11 ** Software or, alternatively, in accordance with the terms contained in
12 ** a written agreement between you and The Qt Company. For licensing terms
13 ** and conditions see https://www.qt.io/terms-conditions. For further
14 ** information use the contact form at https://www.qt.io/contact-us.
15 **
16 ** GNU General Public License Usage
17 ** Alternatively, this file may be used under the terms of the GNU
18 ** General Public License version 3 as published by the Free Software
19 ** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
20 ** included in the packaging of this file. Please review the following
21 ** information to ensure the GNU General Public License requirements will
22 ** be met: https://www.gnu.org/licenses/gpl-3.0.html.
23 **
24 ****************************************************************************/
25 
26 #pragma once
27 
28 #include <QFlags>
29 
30 namespace Debugger {
31 namespace Constants {
32 
33 // Debug mode
34 const char MODE_DEBUG[]             = "Mode.Debug";
35 
36 // Debug mode context
37 const char C_DEBUGMODE[]            = "Debugger.DebugMode";
38 
39 // Common debugger constants.
40 const char kPeripheralDescriptionFile[] = "PeripheralDescriptionFile";
41 
42 // UVSC-specific debugger constants.
43 const char kUVisionProjectFilePath[] = "UVisionProjectFilePath";
44 const char kUVisionOptionsFilePath[] = "UVisionOptionsFilePath";
45 const char kUVisionSimulator[] = "UVisionSimulator";
46 
47 } // namespace Constants
48 
49 // Keep in sync with dumper.py
50 enum DebuggerStartMode
51 {
52     NoStartMode,
53     StartInternal,          // Start current start project's binary
54     StartExternal,          // Start binary found in file system
55     AttachToLocalProcess,   // Attach to running local process by process id
56     AttachToCrashedProcess, // Attach to crashed process by process id
57     AttachToCore,           // Attach to a core file
58     AttachToRemoteServer,   // Attach to a running gdbserver
59     AttachToRemoteProcess,  // Attach to a running remote process
60     AttachToQmlServer,      // Attach to a running QmlServer
61     StartRemoteProcess      // Start and attach to a remote process
62 };
63 
64 enum DebuggerCloseMode
65 {
66     KillAtClose,
67     KillAndExitMonitorAtClose,
68     DetachAtClose
69 };
70 
71 enum DebuggerCapabilities
72 {
73     ReverseSteppingCapability         = 1 <<  0,
74     SnapshotCapability                = 1 <<  1,
75     AutoDerefPointersCapability       = 1 <<  2,
76     DisassemblerCapability            = 1 <<  3,
77     RegisterCapability                = 1 <<  4,
78     ShowMemoryCapability              = 1 <<  5,
79     JumpToLineCapability              = 1 <<  6,
80     ReloadModuleCapability            = 1 <<  7,
81     ReloadModuleSymbolsCapability     = 1 <<  8,
82     BreakOnThrowAndCatchCapability    = 1 <<  9,
83     BreakConditionCapability          = 1 << 10, //!< Conditional Breakpoints
84     BreakModuleCapability             = 1 << 11, //!< Breakpoint specification includes module
85     TracePointCapability              = 1 << 12,
86     ReturnFromFunctionCapability      = 1 << 13,
87     CreateFullBacktraceCapability     = 1 << 14,
88     AddWatcherCapability              = 1 << 15,
89     AddWatcherWhileRunningCapability  = 1 << 16,
90     WatchWidgetsCapability            = 1 << 17,
91     WatchpointByAddressCapability     = 1 << 18,
92     WatchpointByExpressionCapability  = 1 << 19,
93     ShowModuleSymbolsCapability       = 1 << 20,
94     CatchCapability                   = 1 << 21, //!< fork, vfork, syscall
95     OperateByInstructionCapability    = 1 << 22,
96     RunToLineCapability               = 1 << 23,
97     MemoryAddressCapability           = 1 << 24,
98     ShowModuleSectionsCapability      = 1 << 25,
99     WatchComplexExpressionsCapability = 1 << 26, // Used to filter out challenges for cdb.
100     AdditionalQmlStackCapability      = 1 << 27, //!< C++ debugger engine is able to retrieve QML stack as well.
101     ResetInferiorCapability           = 1 << 28, //!< restart program while debugging
102     BreakIndividualLocationsCapability= 1 << 29  //!< Allows to enable/disable individual location for multi-location bps
103 };
104 
105 enum LogChannel
106 {
107     LogInput,                // Used for user input
108     LogMiscInput,            // Used for misc stuff in the input pane
109     LogOutput,
110     LogWarning,
111     LogError,
112     LogStatus,               // Used for status changed messages
113     LogTime,                 // Used for time stamp messages
114     LogDebug,
115     LogMisc,
116     AppOutput,               // stdout
117     AppError,                // stderr
118     AppStuff,                // (possibly) windows debug channel
119     StatusBar,               // LogStatus and also put to the status bar
120     ConsoleOutput            // Used to output to console
121 };
122 
123 // Keep values compatible between Qt Creator versions,
124 // because they are used by the installer for registering debuggers
125 enum DebuggerEngineType
126 {
127     NoEngineType      = 0,
128     GdbEngineType     = 0x001,
129     CdbEngineType     = 0x004,
130     PdbEngineType     = 0x008,
131     LldbEngineType    = 0x100,
132     UvscEngineType    = 0x1000
133 };
134 
135 enum DebuggerLanguage
136 {
137     NoLanguage       = 0x0,
138     CppLanguage      = 0x1,
139     QmlLanguage      = 0x2,
140     AnyLanguage      = CppLanguage | QmlLanguage
141 };
142 
143 Q_DECLARE_FLAGS(DebuggerLanguages, DebuggerLanguage)
144 
145 } // namespace Debugger
146