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