Coverage Report

Created: 2022-01-15 10:30

/Users/buildslave/jenkins/workspace/coverage/llvm-project/lldb/include/lldb/lldb-enumerations.h
Line
Count
Source (jump to first uncovered line)
1
//===-- lldb-enumerations.h -------------------------------------*- C++ -*-===//
2
//
3
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4
// See https://llvm.org/LICENSE.txt for license information.
5
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6
//
7
//===----------------------------------------------------------------------===//
8
9
#ifndef LLDB_LLDB_ENUMERATIONS_H
10
#define LLDB_LLDB_ENUMERATIONS_H
11
12
#include <type_traits>
13
14
#ifndef SWIG
15
// Macro to enable bitmask operations on an enum.  Without this, Enum | Enum
16
// gets promoted to an int, so you have to say Enum a = Enum(eFoo | eBar).  If
17
// you mark Enum with LLDB_MARK_AS_BITMASK_ENUM(Enum), however, you can simply
18
// write Enum a = eFoo | eBar.
19
// Unfortunately, swig<3.0 doesn't recognise the constexpr keyword, so remove
20
// this entire block, as it is not necessary for swig processing.
21
#define LLDB_MARK_AS_BITMASK_ENUM(Enum)                                        \
22
3.72M
  constexpr Enum operator|(Enum a, Enum b) {                                   \
23
3.72M
    return static_cast<Enum>(                                                  \
24
3.72M
        static_cast<std::underlying_type<Enum>::type>(a) |                     \
25
3.72M
        static_cast<std::underlying_type<Enum>::type>(b));                     \
26
3.72M
  }                                                                            \
Unexecuted instantiation: lldb::operator|(lldb::TypeClass, lldb::TypeClass)
Unexecuted instantiation: lldb::operator|(lldb::TraceInstructionControlFlowType, lldb::TraceInstructionControlFlowType)
lldb::operator|(lldb::SymbolContextItem, lldb::SymbolContextItem)
Line
Count
Source
22
757k
  constexpr Enum operator|(Enum a, Enum b) {                                   \
23
757k
    return static_cast<Enum>(                                                  \
24
757k
        static_cast<std::underlying_type<Enum>::type>(a) |                     \
25
757k
        static_cast<std::underlying_type<Enum>::type>(b));                     \
26
757k
  }                                                                            \
lldb::operator|(lldb::Permissions, lldb::Permissions)
Line
Count
Source
22
50.2k
  constexpr Enum operator|(Enum a, Enum b) {                                   \
23
50.2k
    return static_cast<Enum>(                                                  \
24
50.2k
        static_cast<std::underlying_type<Enum>::type>(a) |                     \
25
50.2k
        static_cast<std::underlying_type<Enum>::type>(b));                     \
26
50.2k
  }                                                                            \
lldb::operator|(lldb::FunctionNameType, lldb::FunctionNameType)
Line
Count
Source
22
2.91M
  constexpr Enum operator|(Enum a, Enum b) {                                   \
23
2.91M
    return static_cast<Enum>(                                                  \
24
2.91M
        static_cast<std::underlying_type<Enum>::type>(a) |                     \
25
2.91M
        static_cast<std::underlying_type<Enum>::type>(b));                     \
26
2.91M
  }                                                                            \
27
26.4M
  constexpr Enum operator&(Enum a, Enum b) {                                   \
28
26.4M
    return static_cast<Enum>(                                                  \
29
26.4M
        static_cast<std::underlying_type<Enum>::type>(a) &                     \
30
26.4M
        static_cast<std::underlying_type<Enum>::type>(b));                     \
31
26.4M
  }                                                                            \
Unexecuted instantiation: lldb::operator&(lldb::Permissions, lldb::Permissions)
Unexecuted instantiation: lldb::operator&(lldb::TraceInstructionControlFlowType, lldb::TraceInstructionControlFlowType)
lldb::operator&(lldb::SymbolContextItem, lldb::SymbolContextItem)
Line
Count
Source
27
12.3M
  constexpr Enum operator&(Enum a, Enum b) {                                   \
28
12.3M
    return static_cast<Enum>(                                                  \
29
12.3M
        static_cast<std::underlying_type<Enum>::type>(a) &                     \
30
12.3M
        static_cast<std::underlying_type<Enum>::type>(b));                     \
31
12.3M
  }                                                                            \
lldb::operator&(lldb::FunctionNameType, lldb::FunctionNameType)
Line
Count
Source
27
14.1M
  constexpr Enum operator&(Enum a, Enum b) {                                   \
28
14.1M
    return static_cast<Enum>(                                                  \
29
14.1M
        static_cast<std::underlying_type<Enum>::type>(a) &                     \
30
14.1M
        static_cast<std::underlying_type<Enum>::type>(b));                     \
31
14.1M
  }                                                                            \
lldb::operator&(lldb::TypeClass, lldb::TypeClass)
Line
Count
Source
27
3
  constexpr Enum operator&(Enum a, Enum b) {                                   \
28
3
    return static_cast<Enum>(                                                  \
29
3
        static_cast<std::underlying_type<Enum>::type>(a) &                     \
30
3
        static_cast<std::underlying_type<Enum>::type>(b));                     \
31
3
  }                                                                            \
32
3.68k
  constexpr Enum operator~(Enum a) {                                           \
33
3.68k
    return static_cast<Enum>(                                                  \
34
3.68k
        ~static_cast<std::underlying_type<Enum>::type>(a));                    \
35
3.68k
  }                                                                            \
Unexecuted instantiation: lldb::operator~(lldb::Permissions)
Unexecuted instantiation: lldb::operator~(lldb::TypeClass)
Unexecuted instantiation: lldb::operator~(lldb::TraceInstructionControlFlowType)
lldb::operator~(lldb::SymbolContextItem)
Line
Count
Source
32
62
  constexpr Enum operator~(Enum a) {                                           \
33
62
    return static_cast<Enum>(                                                  \
34
62
        ~static_cast<std::underlying_type<Enum>::type>(a));                    \
35
62
  }                                                                            \
lldb::operator~(lldb::FunctionNameType)
Line
Count
Source
32
3.62k
  constexpr Enum operator~(Enum a) {                                           \
33
3.62k
    return static_cast<Enum>(                                                  \
34
3.62k
        ~static_cast<std::underlying_type<Enum>::type>(a));                    \
35
3.62k
  }                                                                            \
36
113k
  inline Enum &operator|=(Enum &a, Enum b) {                                   \
37
113k
    a = a | b;                                                                 \
38
113k
    return a;                                                                  \
39
113k
  }                                                                            \
Unexecuted instantiation: lldb::operator|=(lldb::TypeClass&, lldb::TypeClass)
Unexecuted instantiation: lldb::operator|=(lldb::TraceInstructionControlFlowType&, lldb::TraceInstructionControlFlowType)
lldb::operator|=(lldb::SymbolContextItem&, lldb::SymbolContextItem)
Line
Count
Source
36
104k
  inline Enum &operator|=(Enum &a, Enum b) {                                   \
37
104k
    a = a | b;                                                                 \
38
104k
    return a;                                                                  \
39
104k
  }                                                                            \
lldb::operator|=(lldb::Permissions&, lldb::Permissions)
Line
Count
Source
36
1.66k
  inline Enum &operator|=(Enum &a, Enum b) {                                   \
37
1.66k
    a = a | b;                                                                 \
38
1.66k
    return a;                                                                  \
39
1.66k
  }                                                                            \
lldb::operator|=(lldb::FunctionNameType&, lldb::FunctionNameType)
Line
Count
Source
36
7.98k
  inline Enum &operator|=(Enum &a, Enum b) {                                   \
37
7.98k
    a = a | b;                                                                 \
38
7.98k
    return a;                                                                  \
39
7.98k
  }                                                                            \
40
0
  inline Enum &operator&=(Enum &a, Enum b) {                                   \
41
0
    a = a & b;                                                                 \
42
0
    return a;                                                                  \
43
0
  }
Unexecuted instantiation: lldb::operator&=(lldb::SymbolContextItem&, lldb::SymbolContextItem)
Unexecuted instantiation: lldb::operator&=(lldb::Permissions&, lldb::Permissions)
Unexecuted instantiation: lldb::operator&=(lldb::FunctionNameType&, lldb::FunctionNameType)
Unexecuted instantiation: lldb::operator&=(lldb::TypeClass&, lldb::TypeClass)
Unexecuted instantiation: lldb::operator&=(lldb::TraceInstructionControlFlowType&, lldb::TraceInstructionControlFlowType)
44
#else
45
#define LLDB_MARK_AS_BITMASK_ENUM(Enum)
46
#endif
47
48
#ifndef SWIG
49
// With MSVC, the default type of an enum is always signed, even if one of the
50
// enumerator values is too large to fit into a signed integer but would
51
// otherwise fit into an unsigned integer.  As a result of this, all of LLDB's
52
// flag-style enumerations that specify something like eValueFoo = 1u << 31
53
// result in negative values.  This usually just results in a benign warning,
54
// but in a few places we actually do comparisons on the enum values, which
55
// would cause a real bug.  Furthermore, there's no way to silence only this
56
// warning, as it's part of -Wmicrosoft which also catches a whole slew of
57
// other useful issues.
58
//
59
// To make matters worse, early versions of SWIG don't recognize the syntax of
60
// specifying the underlying type of an enum (and Python doesn't care anyway)
61
// so we need a way to specify the underlying type when the enum is being used
62
// from C++ code, but just use a regular enum when swig is pre-processing.
63
#define FLAGS_ENUM(Name) enum Name : unsigned
64
#define FLAGS_ANONYMOUS_ENUM() enum : unsigned
65
#else
66
#define FLAGS_ENUM(Name) enum Name
67
#define FLAGS_ANONYMOUS_ENUM() enum
68
#endif
69
70
namespace lldb {
71
72
/// Process and Thread States.
73
enum StateType {
74
  eStateInvalid = 0,
75
  eStateUnloaded,  ///< Process is object is valid, but not currently loaded
76
  eStateConnected, ///< Process is connected to remote debug services, but not
77
                   /// launched or attached to anything yet
78
  eStateAttaching, ///< Process is currently trying to attach
79
  eStateLaunching, ///< Process is in the process of launching
80
  // The state changes eStateAttaching and eStateLaunching are both sent while
81
  // the private state thread is either not yet started or paused. For that
82
  // reason, they should only be signaled as public state changes, and not
83
  // private state changes.
84
  eStateStopped,   ///< Process or thread is stopped and can be examined.
85
  eStateRunning,   ///< Process or thread is running and can't be examined.
86
  eStateStepping,  ///< Process or thread is in the process of stepping and can
87
                   /// not be examined.
88
  eStateCrashed,   ///< Process or thread has crashed and can be examined.
89
  eStateDetached,  ///< Process has been detached and can't be examined.
90
  eStateExited,    ///< Process has exited and can't be examined.
91
  eStateSuspended, ///< Process or thread is in a suspended state as far
92
                   ///< as the debugger is concerned while other processes
93
                   ///< or threads get the chance to run.
94
  kLastStateType = eStateSuspended
95
};
96
97
/// Launch Flags.
98
FLAGS_ENUM(LaunchFlags){
99
    eLaunchFlagNone = 0u,
100
    eLaunchFlagExec = (1u << 0),  ///< Exec when launching and turn the calling
101
                                  /// process into a new process
102
    eLaunchFlagDebug = (1u << 1), ///< Stop as soon as the process launches to
103
                                  /// allow the process to be debugged
104
    eLaunchFlagStopAtEntry = (1u
105
                              << 2), ///< Stop at the program entry point
106
                                     /// instead of auto-continuing when
107
                                     /// launching or attaching at entry point
108
    eLaunchFlagDisableASLR =
109
        (1u << 3), ///< Disable Address Space Layout Randomization
110
    eLaunchFlagDisableSTDIO =
111
        (1u << 4), ///< Disable stdio for inferior process (e.g. for a GUI app)
112
    eLaunchFlagLaunchInTTY =
113
        (1u << 5), ///< Launch the process in a new TTY if supported by the host
114
    eLaunchFlagLaunchInShell =
115
        (1u << 6), ///< Launch the process inside a shell to get shell expansion
116
    eLaunchFlagLaunchInSeparateProcessGroup =
117
        (1u << 7), ///< Launch the process in a separate process group
118
                   ///< If you are going to hand the process off (e.g. to
119
                   ///< debugserver)
120
    eLaunchFlagDontSetExitStatus = (1u << 8),
121
    ///< set this flag so lldb & the handee don't race to set its exit status.
122
    eLaunchFlagDetachOnError = (1u << 9), ///< If set, then the client stub
123
                                          ///< should detach rather than killing
124
                                          ///< the debugee
125
                                          ///< if it loses connection with lldb.
126
    eLaunchFlagShellExpandArguments =
127
        (1u << 10), ///< Perform shell-style argument expansion
128
    eLaunchFlagCloseTTYOnExit = (1u << 11), ///< Close the open TTY on exit
129
    eLaunchFlagInheritTCCFromParent =
130
        (1u << 12), ///< Don't make the inferior responsible for its own TCC
131
                    ///< permissions but instead inherit them from its parent.
132
};
133
134
/// Thread Run Modes.
135
enum RunMode { eOnlyThisThread, eAllThreads, eOnlyDuringStepping };
136
137
/// Byte ordering definitions.
138
enum ByteOrder {
139
  eByteOrderInvalid = 0,
140
  eByteOrderBig = 1,
141
  eByteOrderPDP = 2,
142
  eByteOrderLittle = 4
143
};
144
145
/// Register encoding definitions.
146
enum Encoding {
147
  eEncodingInvalid = 0,
148
  eEncodingUint,    ///< unsigned integer
149
  eEncodingSint,    ///< signed integer
150
  eEncodingIEEE754, ///< float
151
  eEncodingVector   ///< vector registers
152
};
153
154
/// Display format definitions.
155
enum Format {
156
  eFormatDefault = 0,
157
  eFormatInvalid = 0,
158
  eFormatBoolean,
159
  eFormatBinary,
160
  eFormatBytes,
161
  eFormatBytesWithASCII,
162
  eFormatChar,
163
  eFormatCharPrintable, ///< Only printable characters, '.' if not printable
164
  eFormatComplex,       ///< Floating point complex type
165
  eFormatComplexFloat = eFormatComplex,
166
  eFormatCString, ///< NULL terminated C strings
167
  eFormatDecimal,
168
  eFormatEnum,
169
  eFormatHex,
170
  eFormatHexUppercase,
171
  eFormatFloat,
172
  eFormatOctal,
173
  eFormatOSType, ///< OS character codes encoded into an integer 'PICT' 'text'
174
                 ///< etc...
175
  eFormatUnicode16,
176
  eFormatUnicode32,
177
  eFormatUnsigned,
178
  eFormatPointer,
179
  eFormatVectorOfChar,
180
  eFormatVectorOfSInt8,
181
  eFormatVectorOfUInt8,
182
  eFormatVectorOfSInt16,
183
  eFormatVectorOfUInt16,
184
  eFormatVectorOfSInt32,
185
  eFormatVectorOfUInt32,
186
  eFormatVectorOfSInt64,
187
  eFormatVectorOfUInt64,
188
  eFormatVectorOfFloat16,
189
  eFormatVectorOfFloat32,
190
  eFormatVectorOfFloat64,
191
  eFormatVectorOfUInt128,
192
  eFormatComplexInteger, ///< Integer complex type
193
  eFormatCharArray,      ///< Print characters with no single quotes, used for
194
                         ///< character arrays that can contain non printable
195
                         ///< characters
196
  eFormatAddressInfo,    ///< Describe what an address points to (func + offset
197
                      ///< with file/line, symbol + offset, data, etc)
198
  eFormatHexFloat,    ///< ISO C99 hex float string
199
  eFormatInstruction, ///< Disassemble an opcode
200
  eFormatVoid,        ///< Do not print this
201
  eFormatUnicode8,
202
  kNumFormats
203
};
204
205
/// Description levels for "void GetDescription(Stream *, DescriptionLevel)"
206
/// calls.
207
enum DescriptionLevel {
208
  eDescriptionLevelBrief = 0,
209
  eDescriptionLevelFull,
210
  eDescriptionLevelVerbose,
211
  eDescriptionLevelInitial,
212
  kNumDescriptionLevels
213
};
214
215
/// Script interpreter types.
216
enum ScriptLanguage {
217
  eScriptLanguageNone = 0,
218
  eScriptLanguagePython,
219
  eScriptLanguageLua,
220
  eScriptLanguageUnknown,
221
  eScriptLanguageDefault = eScriptLanguagePython
222
};
223
224
/// Register numbering types.
225
// See RegisterContext::ConvertRegisterKindToRegisterNumber to convert any of
226
// these to the lldb internal register numbering scheme (eRegisterKindLLDB).
227
enum RegisterKind {
228
  eRegisterKindEHFrame = 0, ///< the register numbers seen in eh_frame
229
  eRegisterKindDWARF,       ///< the register numbers seen DWARF
230
  eRegisterKindGeneric, ///< insn ptr reg, stack ptr reg, etc not specific to
231
                        ///< any particular target
232
  eRegisterKindProcessPlugin, ///< num used by the process plugin - e.g. by the
233
                              ///< remote gdb-protocol stub program
234
  eRegisterKindLLDB,          ///< lldb's internal register numbers
235
  kNumRegisterKinds
236
};
237
238
/// Thread stop reasons.
239
enum StopReason {
240
  eStopReasonInvalid = 0,
241
  eStopReasonNone,
242
  eStopReasonTrace,
243
  eStopReasonBreakpoint,
244
  eStopReasonWatchpoint,
245
  eStopReasonSignal,
246
  eStopReasonException,
247
  eStopReasonExec, ///< Program was re-exec'ed
248
  eStopReasonPlanComplete,
249
  eStopReasonThreadExiting,
250
  eStopReasonInstrumentation,
251
  eStopReasonProcessorTrace,
252
  eStopReasonFork,
253
  eStopReasonVFork,
254
  eStopReasonVForkDone,
255
};
256
257
/// Command Return Status Types.
258
enum ReturnStatus {
259
  eReturnStatusInvalid,
260
  eReturnStatusSuccessFinishNoResult,
261
  eReturnStatusSuccessFinishResult,
262
  eReturnStatusSuccessContinuingNoResult,
263
  eReturnStatusSuccessContinuingResult,
264
  eReturnStatusStarted,
265
  eReturnStatusFailed,
266
  eReturnStatusQuit
267
};
268
269
/// The results of expression evaluation.
270
enum ExpressionResults {
271
  eExpressionCompleted = 0,
272
  eExpressionSetupError,
273
  eExpressionParseError,
274
  eExpressionDiscarded,
275
  eExpressionInterrupted,
276
  eExpressionHitBreakpoint,
277
  eExpressionTimedOut,
278
  eExpressionResultUnavailable,
279
  eExpressionStoppedForDebug,
280
  eExpressionThreadVanished
281
};
282
283
enum SearchDepth {
284
  eSearchDepthInvalid = 0,
285
  eSearchDepthTarget,
286
  eSearchDepthModule,
287
  eSearchDepthCompUnit,
288
  eSearchDepthFunction,
289
  eSearchDepthBlock,
290
  eSearchDepthAddress,
291
  kLastSearchDepthKind = eSearchDepthAddress
292
};
293
294
/// Connection Status Types.
295
enum ConnectionStatus {
296
  eConnectionStatusSuccess,        ///< Success
297
  eConnectionStatusEndOfFile,      ///< End-of-file encountered
298
  eConnectionStatusError,          ///< Check GetError() for details
299
  eConnectionStatusTimedOut,       ///< Request timed out
300
  eConnectionStatusNoConnection,   ///< No connection
301
  eConnectionStatusLostConnection, ///< Lost connection while connected to a
302
                                   ///< valid connection
303
  eConnectionStatusInterrupted ///< Interrupted read
304
};
305
306
enum ErrorType {
307
  eErrorTypeInvalid,
308
  eErrorTypeGeneric,    ///< Generic errors that can be any value.
309
  eErrorTypeMachKernel, ///< Mach kernel error codes.
310
  eErrorTypePOSIX,      ///< POSIX error codes.
311
  eErrorTypeExpression, ///< These are from the ExpressionResults enum.
312
  eErrorTypeWin32       ///< Standard Win32 error codes.
313
};
314
315
enum ValueType {
316
  eValueTypeInvalid = 0,
317
  eValueTypeVariableGlobal = 1,   ///< globals variable
318
  eValueTypeVariableStatic = 2,   ///< static variable
319
  eValueTypeVariableArgument = 3, ///< function argument variables
320
  eValueTypeVariableLocal = 4,    ///< function local variables
321
  eValueTypeRegister = 5,         ///< stack frame register value
322
  eValueTypeRegisterSet = 6, ///< A collection of stack frame register values
323
  eValueTypeConstResult = 7, ///< constant result variables
324
  eValueTypeVariableThreadLocal = 8 ///< thread local storage variable
325
};
326
327
/// Token size/granularities for Input Readers.
328
329
enum InputReaderGranularity {
330
  eInputReaderGranularityInvalid = 0,
331
  eInputReaderGranularityByte,
332
  eInputReaderGranularityWord,
333
  eInputReaderGranularityLine,
334
  eInputReaderGranularityAll
335
};
336
337
/// These mask bits allow a common interface for queries that can
338
/// limit the amount of information that gets parsed to only the
339
/// information that is requested. These bits also can indicate what
340
/// actually did get resolved during query function calls.
341
///
342
/// Each definition corresponds to a one of the member variables
343
/// in this class, and requests that that item be resolved, or
344
/// indicates that the member did get resolved.
345
FLAGS_ENUM(SymbolContextItem){
346
    /// Set when \a target is requested from a query, or was located
347
    /// in query results
348
    eSymbolContextTarget = (1u << 0),
349
    /// Set when \a module is requested from a query, or was located
350
    /// in query results
351
    eSymbolContextModule = (1u << 1),
352
    /// Set when \a comp_unit is requested from a query, or was
353
    /// located in query results
354
    eSymbolContextCompUnit = (1u << 2),
355
    /// Set when \a function is requested from a query, or was located
356
    /// in query results
357
    eSymbolContextFunction = (1u << 3),
358
    /// Set when the deepest \a block is requested from a query, or
359
    /// was located in query results
360
    eSymbolContextBlock = (1u << 4),
361
    /// Set when \a line_entry is requested from a query, or was
362
    /// located in query results
363
    eSymbolContextLineEntry = (1u << 5),
364
    /// Set when \a symbol is requested from a query, or was located
365
    /// in query results
366
    eSymbolContextSymbol = (1u << 6),
367
    /// Indicates to try and lookup everything up during a routine
368
    /// symbol context query.
369
    eSymbolContextEverything = ((eSymbolContextSymbol << 1) - 1u),
370
    /// Set when \a global or static variable is requested from a
371
    /// query, or was located in query results.
372
    /// eSymbolContextVariable is potentially expensive to lookup so
373
    /// it isn't included in eSymbolContextEverything which stops it
374
    /// from being used during frame PC lookups and many other
375
    /// potential address to symbol context lookups.
376
    eSymbolContextVariable = (1u << 7),
377
};
378
LLDB_MARK_AS_BITMASK_ENUM(SymbolContextItem)
379
380
FLAGS_ENUM(Permissions){ePermissionsWritable = (1u << 0),
381
                        ePermissionsReadable = (1u << 1),
382
                        ePermissionsExecutable = (1u << 2)};
383
LLDB_MARK_AS_BITMASK_ENUM(Permissions)
384
385
enum InputReaderAction {
386
  eInputReaderActivate, ///< reader is newly pushed onto the reader stack
387
  eInputReaderAsynchronousOutputWritten, ///< an async output event occurred;
388
                                         ///< the reader may want to do
389
                                         ///< something
390
  eInputReaderReactivate, ///< reader is on top of the stack again after another
391
                          ///< reader was popped off
392
  eInputReaderDeactivate, ///< another reader was pushed on the stack
393
  eInputReaderGotToken,   ///< reader got one of its tokens (granularity)
394
  eInputReaderInterrupt, ///< reader received an interrupt signal (probably from
395
                         ///< a control-c)
396
  eInputReaderEndOfFile, ///< reader received an EOF char (probably from a
397
                         ///< control-d)
398
  eInputReaderDone       ///< reader was just popped off the stack and is done
399
};
400
401
FLAGS_ENUM(BreakpointEventType){
402
    eBreakpointEventTypeInvalidType = (1u << 0),
403
    eBreakpointEventTypeAdded = (1u << 1),
404
    eBreakpointEventTypeRemoved = (1u << 2),
405
    eBreakpointEventTypeLocationsAdded = (1u << 3), ///< Locations added doesn't
406
                                                    ///< get sent when the
407
                                                    ///< breakpoint is created
408
    eBreakpointEventTypeLocationsRemoved = (1u << 4),
409
    eBreakpointEventTypeLocationsResolved = (1u << 5),
410
    eBreakpointEventTypeEnabled = (1u << 6),
411
    eBreakpointEventTypeDisabled = (1u << 7),
412
    eBreakpointEventTypeCommandChanged = (1u << 8),
413
    eBreakpointEventTypeConditionChanged = (1u << 9),
414
    eBreakpointEventTypeIgnoreChanged = (1u << 10),
415
    eBreakpointEventTypeThreadChanged = (1u << 11),
416
    eBreakpointEventTypeAutoContinueChanged = (1u << 12)};
417
418
FLAGS_ENUM(WatchpointEventType){
419
    eWatchpointEventTypeInvalidType = (1u << 0),
420
    eWatchpointEventTypeAdded = (1u << 1),
421
    eWatchpointEventTypeRemoved = (1u << 2),
422
    eWatchpointEventTypeEnabled = (1u << 6),
423
    eWatchpointEventTypeDisabled = (1u << 7),
424
    eWatchpointEventTypeCommandChanged = (1u << 8),
425
    eWatchpointEventTypeConditionChanged = (1u << 9),
426
    eWatchpointEventTypeIgnoreChanged = (1u << 10),
427
    eWatchpointEventTypeThreadChanged = (1u << 11),
428
    eWatchpointEventTypeTypeChanged = (1u << 12)};
429
430
/// Programming language type.
431
///
432
/// These enumerations use the same language enumerations as the DWARF
433
/// specification for ease of use and consistency.
434
/// The enum -> string code is in Language.cpp, don't change this
435
/// table without updating that code as well.
436
enum LanguageType {
437
  eLanguageTypeUnknown = 0x0000,        ///< Unknown or invalid language value.
438
  eLanguageTypeC89 = 0x0001,            ///< ISO C:1989.
439
  eLanguageTypeC = 0x0002,              ///< Non-standardized C, such as K&R.
440
  eLanguageTypeAda83 = 0x0003,          ///< ISO Ada:1983.
441
  eLanguageTypeC_plus_plus = 0x0004,    ///< ISO C++:1998.
442
  eLanguageTypeCobol74 = 0x0005,        ///< ISO Cobol:1974.
443
  eLanguageTypeCobol85 = 0x0006,        ///< ISO Cobol:1985.
444
  eLanguageTypeFortran77 = 0x0007,      ///< ISO Fortran 77.
445
  eLanguageTypeFortran90 = 0x0008,      ///< ISO Fortran 90.
446
  eLanguageTypePascal83 = 0x0009,       ///< ISO Pascal:1983.
447
  eLanguageTypeModula2 = 0x000a,        ///< ISO Modula-2:1996.
448
  eLanguageTypeJava = 0x000b,           ///< Java.
449
  eLanguageTypeC99 = 0x000c,            ///< ISO C:1999.
450
  eLanguageTypeAda95 = 0x000d,          ///< ISO Ada:1995.
451
  eLanguageTypeFortran95 = 0x000e,      ///< ISO Fortran 95.
452
  eLanguageTypePLI = 0x000f,            ///< ANSI PL/I:1976.
453
  eLanguageTypeObjC = 0x0010,           ///< Objective-C.
454
  eLanguageTypeObjC_plus_plus = 0x0011, ///< Objective-C++.
455
  eLanguageTypeUPC = 0x0012,            ///< Unified Parallel C.
456
  eLanguageTypeD = 0x0013,              ///< D.
457
  eLanguageTypePython = 0x0014,         ///< Python.
458
  // NOTE: The below are DWARF5 constants, subject to change upon
459
  // completion of the DWARF5 specification
460
  eLanguageTypeOpenCL = 0x0015,         ///< OpenCL.
461
  eLanguageTypeGo = 0x0016,             ///< Go.
462
  eLanguageTypeModula3 = 0x0017,        ///< Modula 3.
463
  eLanguageTypeHaskell = 0x0018,        ///< Haskell.
464
  eLanguageTypeC_plus_plus_03 = 0x0019, ///< ISO C++:2003.
465
  eLanguageTypeC_plus_plus_11 = 0x001a, ///< ISO C++:2011.
466
  eLanguageTypeOCaml = 0x001b,          ///< OCaml.
467
  eLanguageTypeRust = 0x001c,           ///< Rust.
468
  eLanguageTypeC11 = 0x001d,            ///< ISO C:2011.
469
  eLanguageTypeSwift = 0x001e,          ///< Swift.
470
  eLanguageTypeJulia = 0x001f,          ///< Julia.
471
  eLanguageTypeDylan = 0x0020,          ///< Dylan.
472
  eLanguageTypeC_plus_plus_14 = 0x0021, ///< ISO C++:2014.
473
  eLanguageTypeFortran03 = 0x0022,      ///< ISO Fortran 2003.
474
  eLanguageTypeFortran08 = 0x0023,      ///< ISO Fortran 2008.
475
  // Vendor Extensions
476
  // Note: Language::GetNameForLanguageType
477
  // assumes these can be used as indexes into array language_names, and
478
  // Language::SetLanguageFromCString and Language::AsCString assume these can
479
  // be used as indexes into array g_languages.
480
  eLanguageTypeMipsAssembler = 0x0024,   ///< Mips_Assembler.
481
  eLanguageTypeExtRenderScript = 0x0025, ///< RenderScript.
482
  eNumLanguageTypes
483
};
484
485
enum InstrumentationRuntimeType {
486
  eInstrumentationRuntimeTypeAddressSanitizer = 0x0000,
487
  eInstrumentationRuntimeTypeThreadSanitizer = 0x0001,
488
  eInstrumentationRuntimeTypeUndefinedBehaviorSanitizer = 0x0002,
489
  eInstrumentationRuntimeTypeMainThreadChecker = 0x0003,
490
  eInstrumentationRuntimeTypeSwiftRuntimeReporting = 0x0004,
491
  eNumInstrumentationRuntimeTypes
492
};
493
494
enum DynamicValueType {
495
  eNoDynamicValues = 0,
496
  eDynamicCanRunTarget = 1,
497
  eDynamicDontRunTarget = 2
498
};
499
500
enum StopShowColumn {
501
  eStopShowColumnAnsiOrCaret = 0,
502
  eStopShowColumnAnsi = 1,
503
  eStopShowColumnCaret = 2,
504
  eStopShowColumnNone = 3
505
};
506
507
enum AccessType {
508
  eAccessNone,
509
  eAccessPublic,
510
  eAccessPrivate,
511
  eAccessProtected,
512
  eAccessPackage
513
};
514
515
enum CommandArgumentType {
516
  eArgTypeAddress = 0,
517
  eArgTypeAddressOrExpression,
518
  eArgTypeAliasName,
519
  eArgTypeAliasOptions,
520
  eArgTypeArchitecture,
521
  eArgTypeBoolean,
522
  eArgTypeBreakpointID,
523
  eArgTypeBreakpointIDRange,
524
  eArgTypeBreakpointName,
525
  eArgTypeByteSize,
526
  eArgTypeClassName,
527
  eArgTypeCommandName,
528
  eArgTypeCount,
529
  eArgTypeDescriptionVerbosity,
530
  eArgTypeDirectoryName,
531
  eArgTypeDisassemblyFlavor,
532
  eArgTypeEndAddress,
533
  eArgTypeExpression,
534
  eArgTypeExpressionPath,
535
  eArgTypeExprFormat,
536
  eArgTypeFileLineColumn,
537
  eArgTypeFilename,
538
  eArgTypeFormat,
539
  eArgTypeFrameIndex,
540
  eArgTypeFullName,
541
  eArgTypeFunctionName,
542
  eArgTypeFunctionOrSymbol,
543
  eArgTypeGDBFormat,
544
  eArgTypeHelpText,
545
  eArgTypeIndex,
546
  eArgTypeLanguage,
547
  eArgTypeLineNum,
548
  eArgTypeLogCategory,
549
  eArgTypeLogChannel,
550
  eArgTypeMethod,
551
  eArgTypeName,
552
  eArgTypeNewPathPrefix,
553
  eArgTypeNumLines,
554
  eArgTypeNumberPerLine,
555
  eArgTypeOffset,
556
  eArgTypeOldPathPrefix,
557
  eArgTypeOneLiner,
558
  eArgTypePath,
559
  eArgTypePermissionsNumber,
560
  eArgTypePermissionsString,
561
  eArgTypePid,
562
  eArgTypePlugin,
563
  eArgTypeProcessName,
564
  eArgTypePythonClass,
565
  eArgTypePythonFunction,
566
  eArgTypePythonScript,
567
  eArgTypeQueueName,
568
  eArgTypeRegisterName,
569
  eArgTypeRegularExpression,
570
  eArgTypeRunArgs,
571
  eArgTypeRunMode,
572
  eArgTypeScriptedCommandSynchronicity,
573
  eArgTypeScriptLang,
574
  eArgTypeSearchWord,
575
  eArgTypeSelector,
576
  eArgTypeSettingIndex,
577
  eArgTypeSettingKey,
578
  eArgTypeSettingPrefix,
579
  eArgTypeSettingVariableName,
580
  eArgTypeShlibName,
581
  eArgTypeSourceFile,
582
  eArgTypeSortOrder,
583
  eArgTypeStartAddress,
584
  eArgTypeSummaryString,
585
  eArgTypeSymbol,
586
  eArgTypeThreadID,
587
  eArgTypeThreadIndex,
588
  eArgTypeThreadName,
589
  eArgTypeTypeName,
590
  eArgTypeUnsignedInteger,
591
  eArgTypeUnixSignal,
592
  eArgTypeVarName,
593
  eArgTypeValue,
594
  eArgTypeWidth,
595
  eArgTypeNone,
596
  eArgTypePlatform,
597
  eArgTypeWatchpointID,
598
  eArgTypeWatchpointIDRange,
599
  eArgTypeWatchType,
600
  eArgRawInput,
601
  eArgTypeCommand,
602
  eArgTypeColumnNum,
603
  eArgTypeModuleUUID,
604
  eArgTypeSaveCoreStyle,
605
  eArgTypeLastArg // Always keep this entry as the last entry in this
606
                  // enumeration!!
607
};
608
609
/// Symbol types.
610
// Symbol holds the SymbolType in a 6-bit field (m_type), so if you get over 63
611
// entries you will have to resize that field.
612
enum SymbolType {
613
  eSymbolTypeAny = 0,
614
  eSymbolTypeInvalid = 0,
615
  eSymbolTypeAbsolute,
616
  eSymbolTypeCode,
617
  eSymbolTypeResolver,
618
  eSymbolTypeData,
619
  eSymbolTypeTrampoline,
620
  eSymbolTypeRuntime,
621
  eSymbolTypeException,
622
  eSymbolTypeSourceFile,
623
  eSymbolTypeHeaderFile,
624
  eSymbolTypeObjectFile,
625
  eSymbolTypeCommonBlock,
626
  eSymbolTypeBlock,
627
  eSymbolTypeLocal,
628
  eSymbolTypeParam,
629
  eSymbolTypeVariable,
630
  eSymbolTypeVariableType,
631
  eSymbolTypeLineEntry,
632
  eSymbolTypeLineHeader,
633
  eSymbolTypeScopeBegin,
634
  eSymbolTypeScopeEnd,
635
  eSymbolTypeAdditional, ///< When symbols take more than one entry, the extra
636
                         ///< entries get this type
637
  eSymbolTypeCompiler,
638
  eSymbolTypeInstrumentation,
639
  eSymbolTypeUndefined,
640
  eSymbolTypeObjCClass,
641
  eSymbolTypeObjCMetaClass,
642
  eSymbolTypeObjCIVar,
643
  eSymbolTypeReExported
644
};
645
646
enum SectionType {
647
  eSectionTypeInvalid,
648
  eSectionTypeCode,
649
  eSectionTypeContainer, ///< The section contains child sections
650
  eSectionTypeData,
651
  eSectionTypeDataCString,         ///< Inlined C string data
652
  eSectionTypeDataCStringPointers, ///< Pointers to C string data
653
  eSectionTypeDataSymbolAddress,   ///< Address of a symbol in the symbol table
654
  eSectionTypeData4,
655
  eSectionTypeData8,
656
  eSectionTypeData16,
657
  eSectionTypeDataPointers,
658
  eSectionTypeDebug,
659
  eSectionTypeZeroFill,
660
  eSectionTypeDataObjCMessageRefs, ///< Pointer to function pointer + selector
661
  eSectionTypeDataObjCCFStrings,   ///< Objective-C const CFString/NSString
662
                                   ///< objects
663
  eSectionTypeDWARFDebugAbbrev,
664
  eSectionTypeDWARFDebugAddr,
665
  eSectionTypeDWARFDebugAranges,
666
  eSectionTypeDWARFDebugCuIndex,
667
  eSectionTypeDWARFDebugFrame,
668
  eSectionTypeDWARFDebugInfo,
669
  eSectionTypeDWARFDebugLine,
670
  eSectionTypeDWARFDebugLoc,
671
  eSectionTypeDWARFDebugMacInfo,
672
  eSectionTypeDWARFDebugMacro,
673
  eSectionTypeDWARFDebugPubNames,
674
  eSectionTypeDWARFDebugPubTypes,
675
  eSectionTypeDWARFDebugRanges,
676
  eSectionTypeDWARFDebugStr,
677
  eSectionTypeDWARFDebugStrOffsets,
678
  eSectionTypeDWARFAppleNames,
679
  eSectionTypeDWARFAppleTypes,
680
  eSectionTypeDWARFAppleNamespaces,
681
  eSectionTypeDWARFAppleObjC,
682
  eSectionTypeELFSymbolTable,       ///< Elf SHT_SYMTAB section
683
  eSectionTypeELFDynamicSymbols,    ///< Elf SHT_DYNSYM section
684
  eSectionTypeELFRelocationEntries, ///< Elf SHT_REL or SHT_REL section
685
  eSectionTypeELFDynamicLinkInfo,   ///< Elf SHT_DYNAMIC section
686
  eSectionTypeEHFrame,
687
  eSectionTypeARMexidx,
688
  eSectionTypeARMextab,
689
  eSectionTypeCompactUnwind, ///< compact unwind section in Mach-O,
690
                             ///< __TEXT,__unwind_info
691
  eSectionTypeGoSymtab,
692
  eSectionTypeAbsoluteAddress, ///< Dummy section for symbols with absolute
693
                               ///< address
694
  eSectionTypeDWARFGNUDebugAltLink,
695
  eSectionTypeDWARFDebugTypes, ///< DWARF .debug_types section
696
  eSectionTypeDWARFDebugNames, ///< DWARF v5 .debug_names
697
  eSectionTypeOther,
698
  eSectionTypeDWARFDebugLineStr,  ///< DWARF v5 .debug_line_str
699
  eSectionTypeDWARFDebugRngLists, ///< DWARF v5 .debug_rnglists
700
  eSectionTypeDWARFDebugLocLists, ///< DWARF v5 .debug_loclists
701
  eSectionTypeDWARFDebugAbbrevDwo,
702
  eSectionTypeDWARFDebugInfoDwo,
703
  eSectionTypeDWARFDebugStrDwo,
704
  eSectionTypeDWARFDebugStrOffsetsDwo,
705
  eSectionTypeDWARFDebugTypesDwo,
706
  eSectionTypeDWARFDebugRngListsDwo,
707
  eSectionTypeDWARFDebugLocDwo,
708
  eSectionTypeDWARFDebugLocListsDwo,
709
  eSectionTypeDWARFDebugTuIndex,
710
};
711
712
FLAGS_ENUM(EmulateInstructionOptions){
713
    eEmulateInstructionOptionNone = (0u),
714
    eEmulateInstructionOptionAutoAdvancePC = (1u << 0),
715
    eEmulateInstructionOptionIgnoreConditions = (1u << 1)};
716
717
FLAGS_ENUM(FunctionNameType){
718
    eFunctionNameTypeNone = 0u,
719
    eFunctionNameTypeAuto =
720
        (1u << 1), ///< Automatically figure out which FunctionNameType
721
                   ///< bits to set based on the function name.
722
    eFunctionNameTypeFull = (1u << 2), ///< The function name.
723
    ///< For C this is the same as just the name of the function For C++ this is
724
    ///< the mangled or demangled version of the mangled name. For ObjC this is
725
    ///< the full function signature with the + or - and the square brackets and
726
    ///< the class and selector
727
    eFunctionNameTypeBase = (1u
728
                             << 3), ///< The function name only, no namespaces
729
                                    ///< or arguments and no class
730
                                    ///< methods or selectors will be searched.
731
    eFunctionNameTypeMethod = (1u << 4), ///< Find function by method name (C++)
732
                                         ///< with no namespace or arguments
733
    eFunctionNameTypeSelector =
734
        (1u << 5), ///< Find function by selector name (ObjC) names
735
    eFunctionNameTypeAny =
736
        eFunctionNameTypeAuto ///< DEPRECATED: use eFunctionNameTypeAuto
737
};
738
LLDB_MARK_AS_BITMASK_ENUM(FunctionNameType)
739
740
/// Basic types enumeration for the public API SBType::GetBasicType().
741
enum BasicType {
742
  eBasicTypeInvalid = 0,
743
  eBasicTypeVoid = 1,
744
  eBasicTypeChar,
745
  eBasicTypeSignedChar,
746
  eBasicTypeUnsignedChar,
747
  eBasicTypeWChar,
748
  eBasicTypeSignedWChar,
749
  eBasicTypeUnsignedWChar,
750
  eBasicTypeChar16,
751
  eBasicTypeChar32,
752
  eBasicTypeShort,
753
  eBasicTypeUnsignedShort,
754
  eBasicTypeInt,
755
  eBasicTypeUnsignedInt,
756
  eBasicTypeLong,
757
  eBasicTypeUnsignedLong,
758
  eBasicTypeLongLong,
759
  eBasicTypeUnsignedLongLong,
760
  eBasicTypeInt128,
761
  eBasicTypeUnsignedInt128,
762
  eBasicTypeBool,
763
  eBasicTypeHalf,
764
  eBasicTypeFloat,
765
  eBasicTypeDouble,
766
  eBasicTypeLongDouble,
767
  eBasicTypeFloatComplex,
768
  eBasicTypeDoubleComplex,
769
  eBasicTypeLongDoubleComplex,
770
  eBasicTypeObjCID,
771
  eBasicTypeObjCClass,
772
  eBasicTypeObjCSel,
773
  eBasicTypeNullPtr,
774
  eBasicTypeOther
775
};
776
777
/// Deprecated
778
enum TraceType {
779
  eTraceTypeNone = 0,
780
781
  /// Intel Processor Trace
782
  eTraceTypeProcessorTrace
783
};
784
785
enum StructuredDataType {
786
  eStructuredDataTypeInvalid = -1,
787
  eStructuredDataTypeNull = 0,
788
  eStructuredDataTypeGeneric,
789
  eStructuredDataTypeArray,
790
  eStructuredDataTypeInteger,
791
  eStructuredDataTypeFloat,
792
  eStructuredDataTypeBoolean,
793
  eStructuredDataTypeString,
794
  eStructuredDataTypeDictionary
795
};
796
797
FLAGS_ENUM(TypeClass){
798
    eTypeClassInvalid = (0u), eTypeClassArray = (1u << 0),
799
    eTypeClassBlockPointer = (1u << 1), eTypeClassBuiltin = (1u << 2),
800
    eTypeClassClass = (1u << 3), eTypeClassComplexFloat = (1u << 4),
801
    eTypeClassComplexInteger = (1u << 5), eTypeClassEnumeration = (1u << 6),
802
    eTypeClassFunction = (1u << 7), eTypeClassMemberPointer = (1u << 8),
803
    eTypeClassObjCObject = (1u << 9), eTypeClassObjCInterface = (1u << 10),
804
    eTypeClassObjCObjectPointer = (1u << 11), eTypeClassPointer = (1u << 12),
805
    eTypeClassReference = (1u << 13), eTypeClassStruct = (1u << 14),
806
    eTypeClassTypedef = (1u << 15), eTypeClassUnion = (1u << 16),
807
    eTypeClassVector = (1u << 17),
808
    // Define the last type class as the MSBit of a 32 bit value
809
    eTypeClassOther = (1u << 31),
810
    // Define a mask that can be used for any type when finding types
811
    eTypeClassAny = (0xffffffffu)};
812
LLDB_MARK_AS_BITMASK_ENUM(TypeClass)
813
814
enum TemplateArgumentKind {
815
  eTemplateArgumentKindNull = 0,
816
  eTemplateArgumentKindType,
817
  eTemplateArgumentKindDeclaration,
818
  eTemplateArgumentKindIntegral,
819
  eTemplateArgumentKindTemplate,
820
  eTemplateArgumentKindTemplateExpansion,
821
  eTemplateArgumentKindExpression,
822
  eTemplateArgumentKindPack,
823
  eTemplateArgumentKindNullPtr,
824
};
825
826
/// Options that can be set for a formatter to alter its behavior. Not
827
/// all of these are applicable to all formatter types.
828
FLAGS_ENUM(TypeOptions){eTypeOptionNone = (0u),
829
                        eTypeOptionCascade = (1u << 0),
830
                        eTypeOptionSkipPointers = (1u << 1),
831
                        eTypeOptionSkipReferences = (1u << 2),
832
                        eTypeOptionHideChildren = (1u << 3),
833
                        eTypeOptionHideValue = (1u << 4),
834
                        eTypeOptionShowOneLiner = (1u << 5),
835
                        eTypeOptionHideNames = (1u << 6),
836
                        eTypeOptionNonCacheable = (1u << 7),
837
                        eTypeOptionHideEmptyAggregates = (1u << 8),
838
                        eTypeOptionFrontEndWantsDereference = (1u << 9)};
839
840
/// This is the return value for frame comparisons.  If you are comparing frame
841
/// A to frame B the following cases arise:
842
///
843
///    1) When frame A pushes frame B (or a frame that ends up pushing
844
///       B) A is Older than B.
845
///
846
///    2) When frame A pushed frame B (or if frameA is on the stack
847
///       but B is not) A is Younger than B.
848
///
849
///    3) When frame A and frame B have the same StackID, they are
850
///       Equal.
851
///
852
///    4) When frame A and frame B have the same immediate parent
853
///       frame, but are not equal, the comparison yields SameParent.
854
///
855
///    5) If the two frames are on different threads or processes the
856
///       comparison is Invalid.
857
///
858
///    6) If for some reason we can't figure out what went on, we
859
///       return Unknown.
860
enum FrameComparison {
861
  eFrameCompareInvalid,
862
  eFrameCompareUnknown,
863
  eFrameCompareEqual,
864
  eFrameCompareSameParent,
865
  eFrameCompareYounger,
866
  eFrameCompareOlder
867
};
868
869
/// File Permissions.
870
///
871
/// Designed to mimic the unix file permission bits so they can be used with
872
/// functions that set 'mode_t' to certain values for permissions.
873
FLAGS_ENUM(FilePermissions){
874
    eFilePermissionsUserRead = (1u << 8),
875
    eFilePermissionsUserWrite = (1u << 7),
876
    eFilePermissionsUserExecute = (1u << 6),
877
    eFilePermissionsGroupRead = (1u << 5),
878
    eFilePermissionsGroupWrite = (1u << 4),
879
    eFilePermissionsGroupExecute = (1u << 3),
880
    eFilePermissionsWorldRead = (1u << 2),
881
    eFilePermissionsWorldWrite = (1u << 1),
882
    eFilePermissionsWorldExecute = (1u << 0),
883
884
    eFilePermissionsUserRW = (eFilePermissionsUserRead |
885
                              eFilePermissionsUserWrite | 0),
886
    eFileFilePermissionsUserRX = (eFilePermissionsUserRead | 0 |
887
                                  eFilePermissionsUserExecute),
888
    eFilePermissionsUserRWX = (eFilePermissionsUserRead |
889
                               eFilePermissionsUserWrite |
890
                               eFilePermissionsUserExecute),
891
892
    eFilePermissionsGroupRW = (eFilePermissionsGroupRead |
893
                               eFilePermissionsGroupWrite | 0),
894
    eFilePermissionsGroupRX = (eFilePermissionsGroupRead | 0 |
895
                               eFilePermissionsGroupExecute),
896
    eFilePermissionsGroupRWX = (eFilePermissionsGroupRead |
897
                                eFilePermissionsGroupWrite |
898
                                eFilePermissionsGroupExecute),
899
900
    eFilePermissionsWorldRW = (eFilePermissionsWorldRead |
901
                               eFilePermissionsWorldWrite | 0),
902
    eFilePermissionsWorldRX = (eFilePermissionsWorldRead | 0 |
903
                               eFilePermissionsWorldExecute),
904
    eFilePermissionsWorldRWX = (eFilePermissionsWorldRead |
905
                                eFilePermissionsWorldWrite |
906
                                eFilePermissionsWorldExecute),
907
908
    eFilePermissionsEveryoneR = (eFilePermissionsUserRead |
909
                                 eFilePermissionsGroupRead |
910
                                 eFilePermissionsWorldRead),
911
    eFilePermissionsEveryoneW = (eFilePermissionsUserWrite |
912
                                 eFilePermissionsGroupWrite |
913
                                 eFilePermissionsWorldWrite),
914
    eFilePermissionsEveryoneX = (eFilePermissionsUserExecute |
915
                                 eFilePermissionsGroupExecute |
916
                                 eFilePermissionsWorldExecute),
917
918
    eFilePermissionsEveryoneRW = (eFilePermissionsEveryoneR |
919
                                  eFilePermissionsEveryoneW | 0),
920
    eFilePermissionsEveryoneRX = (eFilePermissionsEveryoneR | 0 |
921
                                  eFilePermissionsEveryoneX),
922
    eFilePermissionsEveryoneRWX = (eFilePermissionsEveryoneR |
923
                                   eFilePermissionsEveryoneW |
924
                                   eFilePermissionsEveryoneX),
925
    eFilePermissionsFileDefault = eFilePermissionsUserRW,
926
    eFilePermissionsDirectoryDefault = eFilePermissionsUserRWX,
927
};
928
929
/// Queue work item types.
930
///
931
/// The different types of work that can be enqueued on a libdispatch aka Grand
932
/// Central Dispatch (GCD) queue.
933
enum QueueItemKind {
934
  eQueueItemKindUnknown = 0,
935
  eQueueItemKindFunction,
936
  eQueueItemKindBlock
937
};
938
939
/// Queue type.
940
///
941
/// libdispatch aka Grand Central Dispatch (GCD) queues can be either
942
/// serial (executing on one thread) or concurrent (executing on
943
/// multiple threads).
944
enum QueueKind {
945
  eQueueKindUnknown = 0,
946
  eQueueKindSerial,
947
  eQueueKindConcurrent
948
};
949
950
/// Expression Evaluation Stages.
951
///
952
/// These are the cancellable stages of expression evaluation, passed
953
/// to the expression evaluation callback, so that you can interrupt
954
/// expression evaluation at the various points in its lifecycle.
955
enum ExpressionEvaluationPhase {
956
  eExpressionEvaluationParse = 0,
957
  eExpressionEvaluationIRGen,
958
  eExpressionEvaluationExecution,
959
  eExpressionEvaluationComplete
960
};
961
962
/// Architecture-agnostic categorization of instructions for traversing the
963
/// control flow of a trace.
964
///
965
/// A single instruction can match one or more of these categories.
966
FLAGS_ENUM(TraceInstructionControlFlowType){
967
    /// Any instruction.
968
    eTraceInstructionControlFlowTypeInstruction = (1u << 1),
969
    /// A conditional or unconditional branch/jump.
970
    eTraceInstructionControlFlowTypeBranch = (1u << 2),
971
    /// A conditional or unconditional branch/jump that changed
972
    /// the control flow of the program.
973
    eTraceInstructionControlFlowTypeTakenBranch = (1u << 3),
974
    /// A call to a function.
975
    eTraceInstructionControlFlowTypeCall = (1u << 4),
976
    /// A return from a function.
977
    eTraceInstructionControlFlowTypeReturn = (1u << 5)};
978
979
LLDB_MARK_AS_BITMASK_ENUM(TraceInstructionControlFlowType)
980
981
/// Watchpoint Kind.
982
///
983
/// Indicates what types of events cause the watchpoint to fire. Used by Native
984
/// *Protocol-related classes.
985
FLAGS_ENUM(WatchpointKind){eWatchpointKindWrite = (1u << 0),
986
                           eWatchpointKindRead = (1u << 1)};
987
988
enum GdbSignal {
989
  eGdbSignalBadAccess = 0x91,
990
  eGdbSignalBadInstruction = 0x92,
991
  eGdbSignalArithmetic = 0x93,
992
  eGdbSignalEmulation = 0x94,
993
  eGdbSignalSoftware = 0x95,
994
  eGdbSignalBreakpoint = 0x96
995
};
996
997
/// Used with SBHostOS::GetLLDBPath (lldb::PathType) to find files that are
998
/// related to LLDB on the current host machine. Most files are
999
/// relative to LLDB or are in known locations.
1000
enum PathType {
1001
  ePathTypeLLDBShlibDir, ///< The directory where the lldb.so (unix) or LLDB
1002
                         ///< mach-o file in LLDB.framework (MacOSX) exists
1003
  ePathTypeSupportExecutableDir, ///< Find LLDB support executable directory
1004
                                 ///< (debugserver, etc)
1005
  ePathTypeHeaderDir,            ///< Find LLDB header file directory
1006
  ePathTypePythonDir,            ///< Find Python modules (PYTHONPATH) directory
1007
  ePathTypeLLDBSystemPlugins,    ///< System plug-ins directory
1008
  ePathTypeLLDBUserPlugins,      ///< User plug-ins directory
1009
  ePathTypeLLDBTempSystemDir, ///< The LLDB temp directory for this system that
1010
                              ///< will be cleaned up on exit
1011
  ePathTypeGlobalLLDBTempSystemDir, ///< The LLDB temp directory for this
1012
                                    ///< system, NOT cleaned up on a process
1013
                                    ///< exit.
1014
  ePathTypeClangDir ///< Find path to Clang builtin headers
1015
};
1016
1017
/// Kind of member function.
1018
///
1019
/// Used by the type system.
1020
enum MemberFunctionKind {
1021
  eMemberFunctionKindUnknown = 0,    ///< Not sure what the type of this is
1022
  eMemberFunctionKindConstructor,    ///< A function used to create instances
1023
  eMemberFunctionKindDestructor,     ///< A function used to tear down existing
1024
                                     ///< instances
1025
  eMemberFunctionKindInstanceMethod, ///< A function that applies to a specific
1026
                                     ///< instance
1027
  eMemberFunctionKindStaticMethod ///< A function that applies to a type rather
1028
                                  ///< than any instance
1029
};
1030
1031
/// String matching algorithm used by SBTarget.
1032
enum MatchType { eMatchTypeNormal, eMatchTypeRegex, eMatchTypeStartsWith };
1033
1034
/// Bitmask that describes details about a type.
1035
FLAGS_ENUM(TypeFlags){
1036
    eTypeHasChildren = (1u << 0),       eTypeHasValue = (1u << 1),
1037
    eTypeIsArray = (1u << 2),           eTypeIsBlock = (1u << 3),
1038
    eTypeIsBuiltIn = (1u << 4),         eTypeIsClass = (1u << 5),
1039
    eTypeIsCPlusPlus = (1u << 6),       eTypeIsEnumeration = (1u << 7),
1040
    eTypeIsFuncPrototype = (1u << 8),   eTypeIsMember = (1u << 9),
1041
    eTypeIsObjC = (1u << 10),           eTypeIsPointer = (1u << 11),
1042
    eTypeIsReference = (1u << 12),      eTypeIsStructUnion = (1u << 13),
1043
    eTypeIsTemplate = (1u << 14),       eTypeIsTypedef = (1u << 15),
1044
    eTypeIsVector = (1u << 16),         eTypeIsScalar = (1u << 17),
1045
    eTypeIsInteger = (1u << 18),        eTypeIsFloat = (1u << 19),
1046
    eTypeIsComplex = (1u << 20),        eTypeIsSigned = (1u << 21),
1047
    eTypeInstanceIsPointer = (1u << 22)};
1048
1049
FLAGS_ENUM(CommandFlags){
1050
    /// eCommandRequiresTarget
1051
    ///
1052
    /// Ensures a valid target is contained in m_exe_ctx prior to executing the
1053
    /// command. If a target doesn't exist or is invalid, the command will fail
1054
    /// and CommandObject::GetInvalidTargetDescription() will be returned as the
1055
    /// error. CommandObject subclasses can override the virtual function for
1056
    /// GetInvalidTargetDescription() to provide custom strings when needed.
1057
    eCommandRequiresTarget = (1u << 0),
1058
    /// eCommandRequiresProcess
1059
    ///
1060
    /// Ensures a valid process is contained in m_exe_ctx prior to executing the
1061
    /// command. If a process doesn't exist or is invalid, the command will fail
1062
    /// and CommandObject::GetInvalidProcessDescription() will be returned as
1063
    /// the error. CommandObject subclasses can override the virtual function
1064
    /// for GetInvalidProcessDescription() to provide custom strings when
1065
    /// needed.
1066
    eCommandRequiresProcess = (1u << 1),
1067
    /// eCommandRequiresThread
1068
    ///
1069
    /// Ensures a valid thread is contained in m_exe_ctx prior to executing the
1070
    /// command. If a thread doesn't exist or is invalid, the command will fail
1071
    /// and CommandObject::GetInvalidThreadDescription() will be returned as the
1072
    /// error. CommandObject subclasses can override the virtual function for
1073
    /// GetInvalidThreadDescription() to provide custom strings when needed.
1074
    eCommandRequiresThread = (1u << 2),
1075
    /// eCommandRequiresFrame
1076
    ///
1077
    /// Ensures a valid frame is contained in m_exe_ctx prior to executing the
1078
    /// command. If a frame doesn't exist or is invalid, the command will fail
1079
    /// and CommandObject::GetInvalidFrameDescription() will be returned as the
1080
    /// error. CommandObject subclasses can override the virtual function for
1081
    /// GetInvalidFrameDescription() to provide custom strings when needed.
1082
    eCommandRequiresFrame = (1u << 3),
1083
    /// eCommandRequiresRegContext
1084
    ///
1085
    /// Ensures a valid register context (from the selected frame if there is a
1086
    /// frame in m_exe_ctx, or from the selected thread from m_exe_ctx) is
1087
    /// available from m_exe_ctx prior to executing the command. If a target
1088
    /// doesn't exist or is invalid, the command will fail and
1089
    /// CommandObject::GetInvalidRegContextDescription() will be returned as the
1090
    /// error. CommandObject subclasses can override the virtual function for
1091
    /// GetInvalidRegContextDescription() to provide custom strings when needed.
1092
    eCommandRequiresRegContext = (1u << 4),
1093
    /// eCommandTryTargetAPILock
1094
    ///
1095
    /// Attempts to acquire the target lock if a target is selected in the
1096
    /// command interpreter. If the command object fails to acquire the API
1097
    /// lock, the command will fail with an appropriate error message.
1098
    eCommandTryTargetAPILock = (1u << 5),
1099
    /// eCommandProcessMustBeLaunched
1100
    ///
1101
    /// Verifies that there is a launched process in m_exe_ctx, if there isn't,
1102
    /// the command will fail with an appropriate error message.
1103
    eCommandProcessMustBeLaunched = (1u << 6),
1104
    /// eCommandProcessMustBePaused
1105
    ///
1106
    /// Verifies that there is a paused process in m_exe_ctx, if there isn't,
1107
    /// the command will fail with an appropriate error message.
1108
    eCommandProcessMustBePaused = (1u << 7),
1109
    /// eCommandProcessMustBeTraced
1110
    ///
1111
    /// Verifies that the process is being traced by a Trace plug-in, if it
1112
    /// isn't the command will fail with an appropriate error message.
1113
    eCommandProcessMustBeTraced = (1u << 8)};
1114
1115
/// Whether a summary should cap how much data it returns to users or not.
1116
enum TypeSummaryCapping {
1117
  eTypeSummaryCapped = true,
1118
  eTypeSummaryUncapped = false
1119
};
1120
1121
/// The result from a command interpreter run.
1122
enum CommandInterpreterResult {
1123
  /// Command interpreter finished successfully.
1124
  eCommandInterpreterResultSuccess,
1125
  /// Stopped because the corresponding option was set and the inferior
1126
  /// crashed.
1127
  eCommandInterpreterResultInferiorCrash,
1128
  /// Stopped because the corresponding option was set and a command returned
1129
  /// an error.
1130
  eCommandInterpreterResultCommandError,
1131
  /// Stopped because quit was requested.
1132
  eCommandInterpreterResultQuitRequested,
1133
};
1134
1135
// Style of core file to create when calling SaveCore.
1136
enum SaveCoreStyle {
1137
  eSaveCoreUnspecified = 0,
1138
  eSaveCoreFull = 1,
1139
  eSaveCoreDirtyOnly = 2,
1140
  eSaveCoreStackOnly = 3,
1141
};
1142
1143
} // namespace lldb
1144
1145
#endif // LLDB_LLDB_ENUMERATIONS_H