debuggerconstants.h 8.68 KB
Newer Older
1
/**************************************************************************
con's avatar
con committed
2 3 4
**
** This file is part of Qt Creator
**
con's avatar
con committed
5
** Copyright (c) 2011 Nokia Corporation and/or its subsidiary(-ies).
con's avatar
con committed
6
**
hjk's avatar
hjk committed
7
** Contact: Nokia Corporation (info@qt.nokia.com)
con's avatar
con committed
8
**
9
**
10
** GNU Lesser General Public License Usage
11
**
hjk's avatar
hjk committed
12 13 14 15 16 17
** This file may be used under the terms of the GNU Lesser General Public
** License version 2.1 as published by the Free Software Foundation and
** appearing in the file LICENSE.LGPL included in the packaging of this file.
** Please review the following information to ensure the GNU Lesser General
** Public License version 2.1 requirements will be met:
** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
18
**
con's avatar
con committed
19
** In addition, as a special exception, Nokia gives you certain additional
hjk's avatar
hjk committed
20
** rights. These rights are described in the Nokia Qt LGPL Exception
con's avatar
con committed
21 22
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
hjk's avatar
hjk committed
23 24 25 26 27
** Other Usage
**
** Alternatively, this file may be used in accordance with the terms and
** conditions contained in a signed written agreement between you and Nokia.
**
con's avatar
con committed
28 29
** If you have questions regarding the use of this file, please contact
** Nokia at qt-info@nokia.com.
con's avatar
con committed
30
**
31
**************************************************************************/
hjk's avatar
hjk committed
32

con's avatar
con committed
33 34 35
#ifndef DEBUGGERCONSTANTS_H
#define DEBUGGERCONSTANTS_H

36
#include <QtCore/QtGlobal>
37

con's avatar
con committed
38 39 40 41 42 43
namespace Debugger {
namespace Constants {

// modes and their priorities
const char * const MODE_DEBUG           = "Debugger.Mode.Debug";
const int          P_MODE_DEBUG         = 85;
44

con's avatar
con committed
45
// common actions
46 47 48
const char * const INTERRUPT            = "Debugger.Interrupt";
const char * const CONTINUE             = "Debugger.Continue";
const char * const STOP                 = "Debugger.Stop";
con's avatar
con committed
49 50 51 52
const char * const RESET                = "Debugger.Reset";
const char * const STEP                 = "Debugger.StepLine";
const char * const STEPOUT              = "Debugger.StepOut";
const char * const NEXT                 = "Debugger.NextLine";
53
const char * const REVERSE              = "Debugger.ReverseDirection";
54
const char * const OPERATE_BY_INSTRUCTION   = "Debugger.OperateByInstruction";
con's avatar
con committed
55

56
const char * const C_DEBUGMODE          = "Debugger.DebugMode";
57
const char * const C_CPPDEBUGGER        = "Gdb Debugger";
58
const char * const C_QMLDEBUGGER        = "Qml/JavaScript Debugger";
con's avatar
con committed
59

60
const char * const DEBUGGER_COMMON_SETTINGS_ID = "A.Common";
61
const char * const DEBUGGER_COMMON_SETTINGS_NAME =
hjk's avatar
hjk committed
62
    QT_TRANSLATE_NOOP("Debugger", "General");
63
const char * const DEBUGGER_SETTINGS_CATEGORY = "O.Debugger";
64 65
const char * const DEBUGGER_SETTINGS_TR_CATEGORY =
    QT_TRANSLATE_NOOP("Debugger", "Debugger");
66 67
const char * const DEBUGGER_COMMON_SETTINGS_CATEGORY_ICON =
    ":/core/images/category_debug.png";
68

69
// dock widget names
70 71 72 73 74 75
const char * const DOCKWIDGET_BREAK      = "Debugger.Docks.Break";
const char * const DOCKWIDGET_MODULES    = "Debugger.Docks.Modules";
const char * const DOCKWIDGET_REGISTER   = "Debugger.Docks.Register";
const char * const DOCKWIDGET_OUTPUT     = "Debugger.Docks.Output";
const char * const DOCKWIDGET_SNAPSHOTS  = "Debugger.Docks.Snapshots";
const char * const DOCKWIDGET_STACK      = "Debugger.Docks.Stack";
76
const char * const DOCKWIDGET_SOURCE_FILES = "Debugger.Docks.SourceFiles";
77 78
const char * const DOCKWIDGET_THREADS    = "Debugger.Docks.Threads";
const char * const DOCKWIDGET_WATCHERS   = "Debugger.Docks.LocalsAndWatchers";
79 80

const char * const DOCKWIDGET_QML_INSPECTOR = "Debugger.Docks.QmlInspector";
81
const char * const DOCKWIDGET_QML_SCRIPTCONSOLE = "Debugger.Docks.ScriptConsole";
82
const char * const DOCKWIDGET_DEFAULT_AREA = "Debugger.Docks.DefaultArea";
83

Friedemann Kleint's avatar
m.txt  
Friedemann Kleint committed
84 85
namespace Internal {
    enum { debug = 0 };
86
} // namespace Internal
87

88 89
const char * const OPENED_BY_DEBUGGER         = "OpenedByDebugger";
const char * const OPENED_WITH_DISASSEMBLY    = "DisassemblerView";
hjk's avatar
hjk committed
90
const char * const OPENED_WITH_MEMORY         = "MemoryView";
91

92 93 94 95 96 97 98 99 100
const char * const DEBUGMODE            = "Debugger.DebugMode";
const char * const DEBUG                = "Debugger.Debug";
const int          P_ACTION_DEBUG       = 90; //priority for the modemanager
#ifdef Q_OS_MAC
const char * const DEBUG_KEY = "Ctrl+Y";
#else
const char * const DEBUG_KEY = "F5";
#endif

con's avatar
con committed
101
} // namespace Constants
hjk's avatar
hjk committed
102

103

con's avatar
con committed
104
enum DebuggerState
hjk's avatar
hjk committed
105 106 107
{
    DebuggerNotReady,          // Debugger not started

hjk's avatar
hjk committed
108
    EngineSetupRequested,      // Engine starts
109 110
    EngineSetupFailed,
    EngineSetupOk,
111

hjk's avatar
hjk committed
112
    InferiorSetupRequested,
hjk's avatar
hjk committed
113
    InferiorSetupFailed,
114
    InferiorSetupOk,
hjk's avatar
hjk committed
115

hjk's avatar
hjk committed
116 117
    EngineRunRequested,
    EngineRunFailed,
118

hjk's avatar
hjk committed
119
    InferiorUnrunnable,        // Used in the core dump adapter
hjk's avatar
hjk committed
120

hjk's avatar
hjk committed
121 122 123
    InferiorRunRequested,      // Debuggee requested to run
    InferiorRunOk,             // Debuggee running
    InferiorRunFailed,         // Debuggee running
hjk's avatar
hjk committed
124

hjk's avatar
hjk committed
125 126 127 128
    InferiorStopRequested,     // Debuggee running, stop requested
    InferiorStopOk,            // Debuggee stopped
    InferiorStopFailed,        // Debuggee not stopped, will kill debugger

129 130
    InferiorExitOk,

hjk's avatar
hjk committed
131
    InferiorShutdownRequested,
hjk's avatar
hjk committed
132
    InferiorShutdownFailed,
133
    InferiorShutdownOk,
hjk's avatar
hjk committed
134

hjk's avatar
hjk committed
135 136
    EngineShutdownRequested,
    EngineShutdownFailed,
137
    EngineShutdownOk,
hjk's avatar
hjk committed
138 139

    DebuggerFinished
hjk's avatar
hjk committed
140 141 142 143 144 145 146 147 148 149
};

enum DebuggerStartMode
{
    NoStartMode,
    StartInternal,         // Start current start project's binary
    StartExternal,         // Start binary found in file system
    AttachExternal,        // Attach to running process by process id
    AttachCrashedExternal, // Attach to crashed process by process id
    AttachCore,            // Attach to a core file
ck's avatar
ck committed
150
    AttachToRemote,        // Start and attach to a remote process
151 152
    StartRemoteGdb,        // Start gdb itself remotely
    StartRemoteEngine      // Start ipc guest engine on other machine
hjk's avatar
hjk committed
153 154
};

155 156 157 158 159
enum DebuggerCapabilities
{
    ReverseSteppingCapability = 0x1,
    SnapshotCapability = 0x2,
    AutoDerefPointersCapability = 0x4,
160
    DisassemblerCapability = 0x8,
161 162 163 164 165
    RegisterCapability = 0x10,
    ShowMemoryCapability = 0x20,
    JumpToLineCapability = 0x40,
    ReloadModuleCapability = 0x80,
    ReloadModuleSymbolsCapability = 0x100,
166
    BreakOnThrowAndCatchCapability = 0x200,
167 168
    BreakConditionCapability = 0x400, //!< Conditional Breakpoints
    BreakModuleCapability = 0x800, //!< Breakpoint specification includes module
169
    TracePointCapability = 0x1000,
170 171 172 173 174
    ReturnFromFunctionCapability = 0x2000,
    CreateFullBacktraceCapability = 0x4000,
    AddWatcherCapability = 0x8000,
    WatchpointCapability = 0x10000,
    ShowModuleSymbolsCapability = 0x20000,
175
    CatchCapability = 0x40000, //!< fork, vfork, syscall
176
    AllDebuggerCapabilities = 0xFFFFFFFF
177 178
};

hjk's avatar
hjk committed
179 180
enum LogChannel
{
181 182
    LogInput,                // Used for user input
    LogMiscInput,            // Used for misc stuff in the input pane
hjk's avatar
hjk committed
183 184 185
    LogOutput,
    LogWarning,
    LogError,
186 187
    LogStatus,               // Used for status changed messages
    LogTime,                 // Used for time stamp messages
hjk's avatar
hjk committed
188 189 190 191
    LogDebug,
    LogMisc,
    AppOutput,
    AppError,
192
    AppStuff,
193 194
    StatusBar,                // LogStatus and also put to the status bar
    ScriptConsoleOutput
hjk's avatar
hjk committed
195 196 197 198
};

enum ModelRoles
{
199
    DisplaySourceRole = 32,  // Qt::UserRole
200

201 202
    EngineStateRole,
    EngineCapabilitiesRole,
203
    EngineActionsEnabledRole,
204
    RequestActivationRole,
205
    RequestContextMenuRole,
206

207 208
    // Locals and Watchers
    LocalsINameRole,
209 210
    LocalsEditTypeRole,     // A QVariant::type describing the item
    LocalsIntegerBaseRole,  // Number base 16, 10, 8, 2
211
    LocalsExpressionRole,
212
    LocalsRawExpressionRole,
213
    LocalsExpandedRole,     // The preferred expanded state to the view
214 215
    LocalsRawTypeRole,      // Raw type name
    LocalsTypeRole,         // Display type name
216 217 218 219
    LocalsTypeFormatListRole,
    LocalsTypeFormatRole,   // Used to communicate alternative formats to the view
    LocalsIndividualFormatRole,
    LocalsAddressRole,      // Memory address of variable as quint64
220
    LocalsSizeRole,         // Size of variable as quint
221 222 223 224 225
    LocalsRawValueRole,     // Unformatted value as string
    LocalsPointerValueRole, // Pointer value (address) as quint64
    LocalsIsWatchpointAtAddressRole,
    LocalsIsWatchpointAtPointerValueRole,

226
    // Snapshots
227
    SnapshotCapabilityRole
228 229 230 231 232 233 234 235 236 237
};

enum DebuggerEngineType
{
    NoEngineType      = 0,
    GdbEngineType     = 0x01,
    ScriptEngineType  = 0x02,
    CdbEngineType     = 0x04,
    PdbEngineType     = 0x08,
    QmlEngineType     = 0x20,
238
    QmlCppEngineType  = 0x40,
hjk's avatar
hjk committed
239
    LldbEngineType  = 0x80,
240 241 242 243 244
    AllEngineTypes = GdbEngineType
        | ScriptEngineType
        | CdbEngineType
        | PdbEngineType
        | QmlEngineType
245
        | QmlCppEngineType
hjk's avatar
hjk committed
246
        | LldbEngineType
247 248 249 250
};

enum DebuggerLanguage
{
251 252 253
    AnyLanguage       = 0x0,
    CppLanguage      = 0x1,
    QmlLanguage      = 0x2
254
};
255
Q_DECLARE_FLAGS(DebuggerLanguages, DebuggerLanguage)
256

con's avatar
con committed
257 258 259 260
} // namespace Debugger

#endif // DEBUGGERCONSTANTS_H