xref: /llvm-project/lldb/include/lldb/lldb-enumerations.h (revision 22561cfb443267905d4190f0e2a738e6b412457f)
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.
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   eStopReasonInterrupt, ///< Thread requested interrupt
257 };
258 
259 /// Command Return Status Types.
260 enum ReturnStatus {
261   eReturnStatusInvalid,
262   eReturnStatusSuccessFinishNoResult,
263   eReturnStatusSuccessFinishResult,
264   eReturnStatusSuccessContinuingNoResult,
265   eReturnStatusSuccessContinuingResult,
266   eReturnStatusStarted,
267   eReturnStatusFailed,
268   eReturnStatusQuit
269 };
270 
271 /// The results of expression evaluation.
272 enum ExpressionResults {
273   eExpressionCompleted = 0,
274   eExpressionSetupError,
275   eExpressionParseError,
276   eExpressionDiscarded,
277   eExpressionInterrupted,
278   eExpressionHitBreakpoint,
279   eExpressionTimedOut,
280   eExpressionResultUnavailable,
281   eExpressionStoppedForDebug,
282   eExpressionThreadVanished
283 };
284 
285 enum SearchDepth {
286   eSearchDepthInvalid = 0,
287   eSearchDepthTarget,
288   eSearchDepthModule,
289   eSearchDepthCompUnit,
290   eSearchDepthFunction,
291   eSearchDepthBlock,
292   eSearchDepthAddress,
293   kLastSearchDepthKind = eSearchDepthAddress
294 };
295 
296 /// Connection Status Types.
297 enum ConnectionStatus {
298   eConnectionStatusSuccess,        ///< Success
299   eConnectionStatusEndOfFile,      ///< End-of-file encountered
300   eConnectionStatusError,          ///< Check GetError() for details
301   eConnectionStatusTimedOut,       ///< Request timed out
302   eConnectionStatusNoConnection,   ///< No connection
303   eConnectionStatusLostConnection, ///< Lost connection while connected to a
304                                    ///< valid connection
305   eConnectionStatusInterrupted ///< Interrupted read
306 };
307 
308 enum ErrorType {
309   eErrorTypeInvalid,
310   eErrorTypeGeneric,    ///< Generic errors that can be any value.
311   eErrorTypeMachKernel, ///< Mach kernel error codes.
312   eErrorTypePOSIX,      ///< POSIX error codes.
313   eErrorTypeExpression, ///< These are from the ExpressionResults enum.
314   eErrorTypeWin32       ///< Standard Win32 error codes.
315 };
316 
317 enum ValueType {
318   eValueTypeInvalid = 0,
319   eValueTypeVariableGlobal = 1,   ///< globals variable
320   eValueTypeVariableStatic = 2,   ///< static variable
321   eValueTypeVariableArgument = 3, ///< function argument variables
322   eValueTypeVariableLocal = 4,    ///< function local variables
323   eValueTypeRegister = 5,         ///< stack frame register value
324   eValueTypeRegisterSet = 6, ///< A collection of stack frame register values
325   eValueTypeConstResult = 7, ///< constant result variables
326   eValueTypeVariableThreadLocal = 8, ///< thread local storage variable
327   eValueTypeVTable = 9,              ///< virtual function table
328   eValueTypeVTableEntry = 10, ///< function pointer in virtual function table
329 };
330 
331 /// Token size/granularities for Input Readers.
332 
333 enum InputReaderGranularity {
334   eInputReaderGranularityInvalid = 0,
335   eInputReaderGranularityByte,
336   eInputReaderGranularityWord,
337   eInputReaderGranularityLine,
338   eInputReaderGranularityAll
339 };
340 
341 /// These mask bits allow a common interface for queries that can
342 /// limit the amount of information that gets parsed to only the
343 /// information that is requested. These bits also can indicate what
344 /// actually did get resolved during query function calls.
345 ///
346 /// Each definition corresponds to a one of the member variables
347 /// in this class, and requests that that item be resolved, or
348 /// indicates that the member did get resolved.
349 FLAGS_ENUM(SymbolContextItem){
350     /// Set when \a target is requested from a query, or was located
351     /// in query results
352     eSymbolContextTarget = (1u << 0),
353     /// Set when \a module is requested from a query, or was located
354     /// in query results
355     eSymbolContextModule = (1u << 1),
356     /// Set when \a comp_unit is requested from a query, or was
357     /// located in query results
358     eSymbolContextCompUnit = (1u << 2),
359     /// Set when \a function is requested from a query, or was located
360     /// in query results
361     eSymbolContextFunction = (1u << 3),
362     /// Set when the deepest \a block is requested from a query, or
363     /// was located in query results
364     eSymbolContextBlock = (1u << 4),
365     /// Set when \a line_entry is requested from a query, or was
366     /// located in query results
367     eSymbolContextLineEntry = (1u << 5),
368     /// Set when \a symbol is requested from a query, or was located
369     /// in query results
370     eSymbolContextSymbol = (1u << 6),
371     /// Indicates to try and lookup everything up during a routine
372     /// symbol context query.
373     eSymbolContextEverything = ((eSymbolContextSymbol << 1) - 1u),
374     /// Set when \a global or static variable is requested from a
375     /// query, or was located in query results.
376     /// eSymbolContextVariable is potentially expensive to lookup so
377     /// it isn't included in eSymbolContextEverything which stops it
378     /// from being used during frame PC lookups and many other
379     /// potential address to symbol context lookups.
380     eSymbolContextVariable = (1u << 7),
381 
382     // Keep this last and up-to-date for what the last enum value is.
383     eSymbolContextLastItem = eSymbolContextVariable,
384 };
385 LLDB_MARK_AS_BITMASK_ENUM(SymbolContextItem)
386 
387 FLAGS_ENUM(Permissions){ePermissionsWritable = (1u << 0),
388                         ePermissionsReadable = (1u << 1),
389                         ePermissionsExecutable = (1u << 2)};
390 LLDB_MARK_AS_BITMASK_ENUM(Permissions)
391 
392 enum InputReaderAction {
393   eInputReaderActivate, ///< reader is newly pushed onto the reader stack
394   eInputReaderAsynchronousOutputWritten, ///< an async output event occurred;
395                                          ///< the reader may want to do
396                                          ///< something
397   eInputReaderReactivate, ///< reader is on top of the stack again after another
398                           ///< reader was popped off
399   eInputReaderDeactivate, ///< another reader was pushed on the stack
400   eInputReaderGotToken,   ///< reader got one of its tokens (granularity)
401   eInputReaderInterrupt, ///< reader received an interrupt signal (probably from
402                          ///< a control-c)
403   eInputReaderEndOfFile, ///< reader received an EOF char (probably from a
404                          ///< control-d)
405   eInputReaderDone       ///< reader was just popped off the stack and is done
406 };
407 
408 FLAGS_ENUM(BreakpointEventType){
409     eBreakpointEventTypeInvalidType = (1u << 0),
410     eBreakpointEventTypeAdded = (1u << 1),
411     eBreakpointEventTypeRemoved = (1u << 2),
412     eBreakpointEventTypeLocationsAdded = (1u << 3), ///< Locations added doesn't
413                                                     ///< get sent when the
414                                                     ///< breakpoint is created
415     eBreakpointEventTypeLocationsRemoved = (1u << 4),
416     eBreakpointEventTypeLocationsResolved = (1u << 5),
417     eBreakpointEventTypeEnabled = (1u << 6),
418     eBreakpointEventTypeDisabled = (1u << 7),
419     eBreakpointEventTypeCommandChanged = (1u << 8),
420     eBreakpointEventTypeConditionChanged = (1u << 9),
421     eBreakpointEventTypeIgnoreChanged = (1u << 10),
422     eBreakpointEventTypeThreadChanged = (1u << 11),
423     eBreakpointEventTypeAutoContinueChanged = (1u << 12)};
424 
425 FLAGS_ENUM(WatchpointEventType){
426     eWatchpointEventTypeInvalidType = (1u << 0),
427     eWatchpointEventTypeAdded = (1u << 1),
428     eWatchpointEventTypeRemoved = (1u << 2),
429     eWatchpointEventTypeEnabled = (1u << 6),
430     eWatchpointEventTypeDisabled = (1u << 7),
431     eWatchpointEventTypeCommandChanged = (1u << 8),
432     eWatchpointEventTypeConditionChanged = (1u << 9),
433     eWatchpointEventTypeIgnoreChanged = (1u << 10),
434     eWatchpointEventTypeThreadChanged = (1u << 11),
435     eWatchpointEventTypeTypeChanged = (1u << 12)};
436 
437 enum WatchpointWriteType {
438   /// Don't stop when the watched memory region is written to.
439   eWatchpointWriteTypeDisabled,
440   /// Stop on any write access to the memory region, even if
441   /// the value doesn't change.  On some architectures, a write
442   /// near the memory region may be falsely reported as a match,
443   /// and notify this spurious stop as a watchpoint trap.
444   eWatchpointWriteTypeAlways,
445   /// Stop on a write to the memory region that changes its value.
446   /// This is most likely the behavior a user expects, and is the
447   /// behavior in gdb.  lldb can silently ignore writes near the
448   /// watched memory region that are reported as accesses to lldb.
449   eWatchpointWriteTypeOnModify
450 };
451 
452 /// Programming language type.
453 ///
454 /// These enumerations use the same language enumerations as the DWARF
455 /// specification for ease of use and consistency.
456 /// The enum -> string code is in Language.cpp, don't change this
457 /// table without updating that code as well.
458 ///
459 /// This datatype is used in SBExpressionOptions::SetLanguage() which
460 /// makes this type API. Do not change its underlying storage type!
461 enum LanguageType {
462   eLanguageTypeUnknown = 0x0000,        ///< Unknown or invalid language value.
463   eLanguageTypeC89 = 0x0001,            ///< ISO C:1989.
464   eLanguageTypeC = 0x0002,              ///< Non-standardized C, such as K&R.
465   eLanguageTypeAda83 = 0x0003,          ///< ISO Ada:1983.
466   eLanguageTypeC_plus_plus = 0x0004,    ///< ISO C++:1998.
467   eLanguageTypeCobol74 = 0x0005,        ///< ISO Cobol:1974.
468   eLanguageTypeCobol85 = 0x0006,        ///< ISO Cobol:1985.
469   eLanguageTypeFortran77 = 0x0007,      ///< ISO Fortran 77.
470   eLanguageTypeFortran90 = 0x0008,      ///< ISO Fortran 90.
471   eLanguageTypePascal83 = 0x0009,       ///< ISO Pascal:1983.
472   eLanguageTypeModula2 = 0x000a,        ///< ISO Modula-2:1996.
473   eLanguageTypeJava = 0x000b,           ///< Java.
474   eLanguageTypeC99 = 0x000c,            ///< ISO C:1999.
475   eLanguageTypeAda95 = 0x000d,          ///< ISO Ada:1995.
476   eLanguageTypeFortran95 = 0x000e,      ///< ISO Fortran 95.
477   eLanguageTypePLI = 0x000f,            ///< ANSI PL/I:1976.
478   eLanguageTypeObjC = 0x0010,           ///< Objective-C.
479   eLanguageTypeObjC_plus_plus = 0x0011, ///< Objective-C++.
480   eLanguageTypeUPC = 0x0012,            ///< Unified Parallel C.
481   eLanguageTypeD = 0x0013,              ///< D.
482   eLanguageTypePython = 0x0014,         ///< Python.
483   // NOTE: The below are DWARF5 constants, subject to change upon
484   // completion of the DWARF5 specification
485   eLanguageTypeOpenCL = 0x0015,         ///< OpenCL.
486   eLanguageTypeGo = 0x0016,             ///< Go.
487   eLanguageTypeModula3 = 0x0017,        ///< Modula 3.
488   eLanguageTypeHaskell = 0x0018,        ///< Haskell.
489   eLanguageTypeC_plus_plus_03 = 0x0019, ///< ISO C++:2003.
490   eLanguageTypeC_plus_plus_11 = 0x001a, ///< ISO C++:2011.
491   eLanguageTypeOCaml = 0x001b,          ///< OCaml.
492   eLanguageTypeRust = 0x001c,           ///< Rust.
493   eLanguageTypeC11 = 0x001d,            ///< ISO C:2011.
494   eLanguageTypeSwift = 0x001e,          ///< Swift.
495   eLanguageTypeJulia = 0x001f,          ///< Julia.
496   eLanguageTypeDylan = 0x0020,          ///< Dylan.
497   eLanguageTypeC_plus_plus_14 = 0x0021, ///< ISO C++:2014.
498   eLanguageTypeFortran03 = 0x0022,      ///< ISO Fortran 2003.
499   eLanguageTypeFortran08 = 0x0023,      ///< ISO Fortran 2008.
500   eLanguageTypeRenderScript = 0x0024,
501   eLanguageTypeBLISS = 0x0025,
502   eLanguageTypeKotlin = 0x0026,
503   eLanguageTypeZig = 0x0027,
504   eLanguageTypeCrystal = 0x0028,
505   eLanguageTypeC_plus_plus_17 = 0x002a, ///< ISO C++:2017.
506   eLanguageTypeC_plus_plus_20 = 0x002b, ///< ISO C++:2020.
507   eLanguageTypeC17 = 0x002c,
508   eLanguageTypeFortran18 = 0x002d,
509   eLanguageTypeAda2005 = 0x002e,
510   eLanguageTypeAda2012 = 0x002f,
511   eLanguageTypeHIP = 0x0030,
512   eLanguageTypeAssembly = 0x0031,
513   eLanguageTypeC_sharp = 0x0032,
514   eLanguageTypeMojo = 0x0033,
515 
516   // Vendor Extensions
517   // Note: Language::GetNameForLanguageType
518   // assumes these can be used as indexes into array language_names, and
519   // Language::SetLanguageFromCString and Language::AsCString assume these can
520   // be used as indexes into array g_languages.
521   eLanguageTypeMipsAssembler, ///< Mips_Assembler.
522   // Mojo will move to the common list of languages once the DWARF committee
523   // creates a language code for it.
524   eNumLanguageTypes
525 };
526 
527 enum InstrumentationRuntimeType {
528   eInstrumentationRuntimeTypeAddressSanitizer = 0x0000,
529   eInstrumentationRuntimeTypeThreadSanitizer = 0x0001,
530   eInstrumentationRuntimeTypeUndefinedBehaviorSanitizer = 0x0002,
531   eInstrumentationRuntimeTypeMainThreadChecker = 0x0003,
532   eInstrumentationRuntimeTypeSwiftRuntimeReporting = 0x0004,
533   eInstrumentationRuntimeTypeLibsanitizersAsan = 0x0005,
534   eNumInstrumentationRuntimeTypes
535 };
536 
537 enum DynamicValueType {
538   eNoDynamicValues = 0,
539   eDynamicCanRunTarget = 1,
540   eDynamicDontRunTarget = 2
541 };
542 
543 enum StopShowColumn {
544   eStopShowColumnAnsiOrCaret = 0,
545   eStopShowColumnAnsi = 1,
546   eStopShowColumnCaret = 2,
547   eStopShowColumnNone = 3
548 };
549 
550 enum AccessType {
551   eAccessNone,
552   eAccessPublic,
553   eAccessPrivate,
554   eAccessProtected,
555   eAccessPackage
556 };
557 
558 enum CommandArgumentType {
559   eArgTypeAddress = 0,
560   eArgTypeAddressOrExpression,
561   eArgTypeAliasName,
562   eArgTypeAliasOptions,
563   eArgTypeArchitecture,
564   eArgTypeBoolean,
565   eArgTypeBreakpointID,
566   eArgTypeBreakpointIDRange,
567   eArgTypeBreakpointName,
568   eArgTypeByteSize,
569   eArgTypeClassName,
570   eArgTypeCommandName,
571   eArgTypeCount,
572   eArgTypeDescriptionVerbosity,
573   eArgTypeDirectoryName,
574   eArgTypeDisassemblyFlavor,
575   eArgTypeEndAddress,
576   eArgTypeExpression,
577   eArgTypeExpressionPath,
578   eArgTypeExprFormat,
579   eArgTypeFileLineColumn,
580   eArgTypeFilename,
581   eArgTypeFormat,
582   eArgTypeFrameIndex,
583   eArgTypeFullName,
584   eArgTypeFunctionName,
585   eArgTypeFunctionOrSymbol,
586   eArgTypeGDBFormat,
587   eArgTypeHelpText,
588   eArgTypeIndex,
589   eArgTypeLanguage,
590   eArgTypeLineNum,
591   eArgTypeLogCategory,
592   eArgTypeLogChannel,
593   eArgTypeMethod,
594   eArgTypeName,
595   eArgTypeNewPathPrefix,
596   eArgTypeNumLines,
597   eArgTypeNumberPerLine,
598   eArgTypeOffset,
599   eArgTypeOldPathPrefix,
600   eArgTypeOneLiner,
601   eArgTypePath,
602   eArgTypePermissionsNumber,
603   eArgTypePermissionsString,
604   eArgTypePid,
605   eArgTypePlugin,
606   eArgTypeProcessName,
607   eArgTypePythonClass,
608   eArgTypePythonFunction,
609   eArgTypePythonScript,
610   eArgTypeQueueName,
611   eArgTypeRegisterName,
612   eArgTypeRegularExpression,
613   eArgTypeRunArgs,
614   eArgTypeRunMode,
615   eArgTypeScriptedCommandSynchronicity,
616   eArgTypeScriptLang,
617   eArgTypeSearchWord,
618   eArgTypeSelector,
619   eArgTypeSettingIndex,
620   eArgTypeSettingKey,
621   eArgTypeSettingPrefix,
622   eArgTypeSettingVariableName,
623   eArgTypeShlibName,
624   eArgTypeSourceFile,
625   eArgTypeSortOrder,
626   eArgTypeStartAddress,
627   eArgTypeSummaryString,
628   eArgTypeSymbol,
629   eArgTypeThreadID,
630   eArgTypeThreadIndex,
631   eArgTypeThreadName,
632   eArgTypeTypeName,
633   eArgTypeUnsignedInteger,
634   eArgTypeUnixSignal,
635   eArgTypeVarName,
636   eArgTypeValue,
637   eArgTypeWidth,
638   eArgTypeNone,
639   eArgTypePlatform,
640   eArgTypeWatchpointID,
641   eArgTypeWatchpointIDRange,
642   eArgTypeWatchType,
643   eArgRawInput,
644   eArgTypeCommand,
645   eArgTypeColumnNum,
646   eArgTypeModuleUUID,
647   eArgTypeSaveCoreStyle,
648   eArgTypeLogHandler,
649   eArgTypeSEDStylePair,
650   eArgTypeRecognizerID,
651   eArgTypeConnectURL,
652   eArgTypeTargetID,
653   eArgTypeStopHookID,
654   eArgTypeCompletionType,
655   eArgTypeRemotePath,
656   eArgTypeRemoteFilename,
657   eArgTypeModule,
658   eArgTypeCPUName,
659   eArgTypeCPUFeatures,
660   eArgTypeLastArg // Always keep this entry as the last entry in this
661                   // enumeration!!
662 };
663 
664 /// Symbol types.
665 // Symbol holds the SymbolType in a 6-bit field (m_type), so if you get over 63
666 // entries you will have to resize that field.
667 enum SymbolType {
668   eSymbolTypeAny = 0,
669   eSymbolTypeInvalid = 0,
670   eSymbolTypeAbsolute,
671   eSymbolTypeCode,
672   eSymbolTypeResolver,
673   eSymbolTypeData,
674   eSymbolTypeTrampoline,
675   eSymbolTypeRuntime,
676   eSymbolTypeException,
677   eSymbolTypeSourceFile,
678   eSymbolTypeHeaderFile,
679   eSymbolTypeObjectFile,
680   eSymbolTypeCommonBlock,
681   eSymbolTypeBlock,
682   eSymbolTypeLocal,
683   eSymbolTypeParam,
684   eSymbolTypeVariable,
685   eSymbolTypeVariableType,
686   eSymbolTypeLineEntry,
687   eSymbolTypeLineHeader,
688   eSymbolTypeScopeBegin,
689   eSymbolTypeScopeEnd,
690   eSymbolTypeAdditional, ///< When symbols take more than one entry, the extra
691                          ///< entries get this type
692   eSymbolTypeCompiler,
693   eSymbolTypeInstrumentation,
694   eSymbolTypeUndefined,
695   eSymbolTypeObjCClass,
696   eSymbolTypeObjCMetaClass,
697   eSymbolTypeObjCIVar,
698   eSymbolTypeReExported
699 };
700 
701 enum SectionType {
702   eSectionTypeInvalid,
703   eSectionTypeCode,
704   eSectionTypeContainer, ///< The section contains child sections
705   eSectionTypeData,
706   eSectionTypeDataCString,         ///< Inlined C string data
707   eSectionTypeDataCStringPointers, ///< Pointers to C string data
708   eSectionTypeDataSymbolAddress,   ///< Address of a symbol in the symbol table
709   eSectionTypeData4,
710   eSectionTypeData8,
711   eSectionTypeData16,
712   eSectionTypeDataPointers,
713   eSectionTypeDebug,
714   eSectionTypeZeroFill,
715   eSectionTypeDataObjCMessageRefs, ///< Pointer to function pointer + selector
716   eSectionTypeDataObjCCFStrings,   ///< Objective-C const CFString/NSString
717                                    ///< objects
718   eSectionTypeDWARFDebugAbbrev,
719   eSectionTypeDWARFDebugAddr,
720   eSectionTypeDWARFDebugAranges,
721   eSectionTypeDWARFDebugCuIndex,
722   eSectionTypeDWARFDebugFrame,
723   eSectionTypeDWARFDebugInfo,
724   eSectionTypeDWARFDebugLine,
725   eSectionTypeDWARFDebugLoc,
726   eSectionTypeDWARFDebugMacInfo,
727   eSectionTypeDWARFDebugMacro,
728   eSectionTypeDWARFDebugPubNames,
729   eSectionTypeDWARFDebugPubTypes,
730   eSectionTypeDWARFDebugRanges,
731   eSectionTypeDWARFDebugStr,
732   eSectionTypeDWARFDebugStrOffsets,
733   eSectionTypeDWARFAppleNames,
734   eSectionTypeDWARFAppleTypes,
735   eSectionTypeDWARFAppleNamespaces,
736   eSectionTypeDWARFAppleObjC,
737   eSectionTypeELFSymbolTable,       ///< Elf SHT_SYMTAB section
738   eSectionTypeELFDynamicSymbols,    ///< Elf SHT_DYNSYM section
739   eSectionTypeELFRelocationEntries, ///< Elf SHT_REL or SHT_REL section
740   eSectionTypeELFDynamicLinkInfo,   ///< Elf SHT_DYNAMIC section
741   eSectionTypeEHFrame,
742   eSectionTypeARMexidx,
743   eSectionTypeARMextab,
744   eSectionTypeCompactUnwind, ///< compact unwind section in Mach-O,
745                              ///< __TEXT,__unwind_info
746   eSectionTypeGoSymtab,
747   eSectionTypeAbsoluteAddress, ///< Dummy section for symbols with absolute
748                                ///< address
749   eSectionTypeDWARFGNUDebugAltLink,
750   eSectionTypeDWARFDebugTypes, ///< DWARF .debug_types section
751   eSectionTypeDWARFDebugNames, ///< DWARF v5 .debug_names
752   eSectionTypeOther,
753   eSectionTypeDWARFDebugLineStr,  ///< DWARF v5 .debug_line_str
754   eSectionTypeDWARFDebugRngLists, ///< DWARF v5 .debug_rnglists
755   eSectionTypeDWARFDebugLocLists, ///< DWARF v5 .debug_loclists
756   eSectionTypeDWARFDebugAbbrevDwo,
757   eSectionTypeDWARFDebugInfoDwo,
758   eSectionTypeDWARFDebugStrDwo,
759   eSectionTypeDWARFDebugStrOffsetsDwo,
760   eSectionTypeDWARFDebugTypesDwo,
761   eSectionTypeDWARFDebugRngListsDwo,
762   eSectionTypeDWARFDebugLocDwo,
763   eSectionTypeDWARFDebugLocListsDwo,
764   eSectionTypeDWARFDebugTuIndex,
765   eSectionTypeCTF,
766   eSectionTypeLLDBTypeSummaries,
767   eSectionTypeLLDBFormatters,
768   eSectionTypeSwiftModules,
769 };
770 
771 FLAGS_ENUM(EmulateInstructionOptions){
772     eEmulateInstructionOptionNone = (0u),
773     eEmulateInstructionOptionAutoAdvancePC = (1u << 0),
774     eEmulateInstructionOptionIgnoreConditions = (1u << 1)};
775 
776 FLAGS_ENUM(FunctionNameType){
777     eFunctionNameTypeNone = 0u,
778     eFunctionNameTypeAuto =
779         (1u << 1), ///< Automatically figure out which FunctionNameType
780                    ///< bits to set based on the function name.
781     eFunctionNameTypeFull = (1u << 2), ///< The function name.
782     ///< For C this is the same as just the name of the function For C++ this is
783     ///< the mangled or demangled version of the mangled name. For ObjC this is
784     ///< the full function signature with the + or - and the square brackets and
785     ///< the class and selector
786     eFunctionNameTypeBase = (1u
787                              << 3), ///< The function name only, no namespaces
788                                     ///< or arguments and no class
789                                     ///< methods or selectors will be searched.
790     eFunctionNameTypeMethod = (1u << 4), ///< Find function by method name (C++)
791                                          ///< with no namespace or arguments
792     eFunctionNameTypeSelector =
793         (1u << 5), ///< Find function by selector name (ObjC) names
794     eFunctionNameTypeAny =
795         eFunctionNameTypeAuto ///< DEPRECATED: use eFunctionNameTypeAuto
796 };
797 LLDB_MARK_AS_BITMASK_ENUM(FunctionNameType)
798 
799 /// Basic types enumeration for the public API SBType::GetBasicType().
800 enum BasicType {
801   eBasicTypeInvalid = 0,
802   eBasicTypeVoid = 1,
803   eBasicTypeChar,
804   eBasicTypeSignedChar,
805   eBasicTypeUnsignedChar,
806   eBasicTypeWChar,
807   eBasicTypeSignedWChar,
808   eBasicTypeUnsignedWChar,
809   eBasicTypeChar16,
810   eBasicTypeChar32,
811   eBasicTypeChar8,
812   eBasicTypeShort,
813   eBasicTypeUnsignedShort,
814   eBasicTypeInt,
815   eBasicTypeUnsignedInt,
816   eBasicTypeLong,
817   eBasicTypeUnsignedLong,
818   eBasicTypeLongLong,
819   eBasicTypeUnsignedLongLong,
820   eBasicTypeInt128,
821   eBasicTypeUnsignedInt128,
822   eBasicTypeBool,
823   eBasicTypeHalf,
824   eBasicTypeFloat,
825   eBasicTypeDouble,
826   eBasicTypeLongDouble,
827   eBasicTypeFloatComplex,
828   eBasicTypeDoubleComplex,
829   eBasicTypeLongDoubleComplex,
830   eBasicTypeObjCID,
831   eBasicTypeObjCClass,
832   eBasicTypeObjCSel,
833   eBasicTypeNullPtr,
834   eBasicTypeOther
835 };
836 
837 /// Deprecated
838 enum TraceType {
839   eTraceTypeNone = 0,
840 
841   /// Intel Processor Trace
842   eTraceTypeProcessorTrace
843 };
844 
845 enum StructuredDataType {
846   eStructuredDataTypeInvalid = -1,
847   eStructuredDataTypeNull = 0,
848   eStructuredDataTypeGeneric,
849   eStructuredDataTypeArray,
850   eStructuredDataTypeInteger,
851   eStructuredDataTypeFloat,
852   eStructuredDataTypeBoolean,
853   eStructuredDataTypeString,
854   eStructuredDataTypeDictionary,
855   eStructuredDataTypeSignedInteger,
856   eStructuredDataTypeUnsignedInteger = eStructuredDataTypeInteger,
857 };
858 
859 FLAGS_ENUM(TypeClass){
860     eTypeClassInvalid = (0u), eTypeClassArray = (1u << 0),
861     eTypeClassBlockPointer = (1u << 1), eTypeClassBuiltin = (1u << 2),
862     eTypeClassClass = (1u << 3), eTypeClassComplexFloat = (1u << 4),
863     eTypeClassComplexInteger = (1u << 5), eTypeClassEnumeration = (1u << 6),
864     eTypeClassFunction = (1u << 7), eTypeClassMemberPointer = (1u << 8),
865     eTypeClassObjCObject = (1u << 9), eTypeClassObjCInterface = (1u << 10),
866     eTypeClassObjCObjectPointer = (1u << 11), eTypeClassPointer = (1u << 12),
867     eTypeClassReference = (1u << 13), eTypeClassStruct = (1u << 14),
868     eTypeClassTypedef = (1u << 15), eTypeClassUnion = (1u << 16),
869     eTypeClassVector = (1u << 17),
870     // Define the last type class as the MSBit of a 32 bit value
871     eTypeClassOther = (1u << 31),
872     // Define a mask that can be used for any type when finding types
873     eTypeClassAny = (0xffffffffu)};
874 LLDB_MARK_AS_BITMASK_ENUM(TypeClass)
875 
876 enum TemplateArgumentKind {
877   eTemplateArgumentKindNull = 0,
878   eTemplateArgumentKindType,
879   eTemplateArgumentKindDeclaration,
880   eTemplateArgumentKindIntegral,
881   eTemplateArgumentKindTemplate,
882   eTemplateArgumentKindTemplateExpansion,
883   eTemplateArgumentKindExpression,
884   eTemplateArgumentKindPack,
885   eTemplateArgumentKindNullPtr,
886   eTemplateArgumentKindStructuralValue,
887 };
888 
889 /// Type of match to be performed when looking for a formatter for a data type.
890 /// Used by classes like SBTypeNameSpecifier or lldb_private::TypeMatcher.
891 enum FormatterMatchType {
892   eFormatterMatchExact,
893   eFormatterMatchRegex,
894   eFormatterMatchCallback,
895 
896   eLastFormatterMatchType = eFormatterMatchCallback,
897 };
898 
899 /// Options that can be set for a formatter to alter its behavior. Not
900 /// all of these are applicable to all formatter types.
901 FLAGS_ENUM(TypeOptions){eTypeOptionNone = (0u),
902                         eTypeOptionCascade = (1u << 0),
903                         eTypeOptionSkipPointers = (1u << 1),
904                         eTypeOptionSkipReferences = (1u << 2),
905                         eTypeOptionHideChildren = (1u << 3),
906                         eTypeOptionHideValue = (1u << 4),
907                         eTypeOptionShowOneLiner = (1u << 5),
908                         eTypeOptionHideNames = (1u << 6),
909                         eTypeOptionNonCacheable = (1u << 7),
910                         eTypeOptionHideEmptyAggregates = (1u << 8),
911                         eTypeOptionFrontEndWantsDereference = (1u << 9)};
912 
913 /// This is the return value for frame comparisons.  If you are comparing frame
914 /// A to frame B the following cases arise:
915 ///
916 ///    1) When frame A pushes frame B (or a frame that ends up pushing
917 ///       B) A is Older than B.
918 ///
919 ///    2) When frame A pushed frame B (or if frameA is on the stack
920 ///       but B is not) A is Younger than B.
921 ///
922 ///    3) When frame A and frame B have the same StackID, they are
923 ///       Equal.
924 ///
925 ///    4) When frame A and frame B have the same immediate parent
926 ///       frame, but are not equal, the comparison yields SameParent.
927 ///
928 ///    5) If the two frames are on different threads or processes the
929 ///       comparison is Invalid.
930 ///
931 ///    6) If for some reason we can't figure out what went on, we
932 ///       return Unknown.
933 enum FrameComparison {
934   eFrameCompareInvalid,
935   eFrameCompareUnknown,
936   eFrameCompareEqual,
937   eFrameCompareSameParent,
938   eFrameCompareYounger,
939   eFrameCompareOlder
940 };
941 
942 /// File Permissions.
943 ///
944 /// Designed to mimic the unix file permission bits so they can be used with
945 /// functions that set 'mode_t' to certain values for permissions.
946 FLAGS_ENUM(FilePermissions){
947     eFilePermissionsUserRead = (1u << 8),
948     eFilePermissionsUserWrite = (1u << 7),
949     eFilePermissionsUserExecute = (1u << 6),
950     eFilePermissionsGroupRead = (1u << 5),
951     eFilePermissionsGroupWrite = (1u << 4),
952     eFilePermissionsGroupExecute = (1u << 3),
953     eFilePermissionsWorldRead = (1u << 2),
954     eFilePermissionsWorldWrite = (1u << 1),
955     eFilePermissionsWorldExecute = (1u << 0),
956 
957     eFilePermissionsUserRW = (eFilePermissionsUserRead |
958                               eFilePermissionsUserWrite | 0),
959     eFileFilePermissionsUserRX = (eFilePermissionsUserRead | 0 |
960                                   eFilePermissionsUserExecute),
961     eFilePermissionsUserRWX = (eFilePermissionsUserRead |
962                                eFilePermissionsUserWrite |
963                                eFilePermissionsUserExecute),
964 
965     eFilePermissionsGroupRW = (eFilePermissionsGroupRead |
966                                eFilePermissionsGroupWrite | 0),
967     eFilePermissionsGroupRX = (eFilePermissionsGroupRead | 0 |
968                                eFilePermissionsGroupExecute),
969     eFilePermissionsGroupRWX = (eFilePermissionsGroupRead |
970                                 eFilePermissionsGroupWrite |
971                                 eFilePermissionsGroupExecute),
972 
973     eFilePermissionsWorldRW = (eFilePermissionsWorldRead |
974                                eFilePermissionsWorldWrite | 0),
975     eFilePermissionsWorldRX = (eFilePermissionsWorldRead | 0 |
976                                eFilePermissionsWorldExecute),
977     eFilePermissionsWorldRWX = (eFilePermissionsWorldRead |
978                                 eFilePermissionsWorldWrite |
979                                 eFilePermissionsWorldExecute),
980 
981     eFilePermissionsEveryoneR = (eFilePermissionsUserRead |
982                                  eFilePermissionsGroupRead |
983                                  eFilePermissionsWorldRead),
984     eFilePermissionsEveryoneW = (eFilePermissionsUserWrite |
985                                  eFilePermissionsGroupWrite |
986                                  eFilePermissionsWorldWrite),
987     eFilePermissionsEveryoneX = (eFilePermissionsUserExecute |
988                                  eFilePermissionsGroupExecute |
989                                  eFilePermissionsWorldExecute),
990 
991     eFilePermissionsEveryoneRW = (eFilePermissionsEveryoneR |
992                                   eFilePermissionsEveryoneW | 0),
993     eFilePermissionsEveryoneRX = (eFilePermissionsEveryoneR | 0 |
994                                   eFilePermissionsEveryoneX),
995     eFilePermissionsEveryoneRWX = (eFilePermissionsEveryoneR |
996                                    eFilePermissionsEveryoneW |
997                                    eFilePermissionsEveryoneX),
998     eFilePermissionsFileDefault = eFilePermissionsUserRW,
999     eFilePermissionsDirectoryDefault = eFilePermissionsUserRWX,
1000 };
1001 
1002 /// Queue work item types.
1003 ///
1004 /// The different types of work that can be enqueued on a libdispatch aka Grand
1005 /// Central Dispatch (GCD) queue.
1006 enum QueueItemKind {
1007   eQueueItemKindUnknown = 0,
1008   eQueueItemKindFunction,
1009   eQueueItemKindBlock
1010 };
1011 
1012 /// Queue type.
1013 ///
1014 /// libdispatch aka Grand Central Dispatch (GCD) queues can be either
1015 /// serial (executing on one thread) or concurrent (executing on
1016 /// multiple threads).
1017 enum QueueKind {
1018   eQueueKindUnknown = 0,
1019   eQueueKindSerial,
1020   eQueueKindConcurrent
1021 };
1022 
1023 /// Expression Evaluation Stages.
1024 ///
1025 /// These are the cancellable stages of expression evaluation, passed
1026 /// to the expression evaluation callback, so that you can interrupt
1027 /// expression evaluation at the various points in its lifecycle.
1028 enum ExpressionEvaluationPhase {
1029   eExpressionEvaluationParse = 0,
1030   eExpressionEvaluationIRGen,
1031   eExpressionEvaluationExecution,
1032   eExpressionEvaluationComplete
1033 };
1034 
1035 /// Architecture-agnostic categorization of instructions for traversing the
1036 /// control flow of a trace.
1037 ///
1038 /// A single instruction can match one or more of these categories.
1039 enum InstructionControlFlowKind {
1040   /// The instruction could not be classified.
1041   eInstructionControlFlowKindUnknown = 0,
1042   /// The instruction is something not listed below, i.e. it's a sequential
1043   /// instruction that doesn't affect the control flow of the program.
1044   eInstructionControlFlowKindOther,
1045   /// The instruction is a near (function) call.
1046   eInstructionControlFlowKindCall,
1047   /// The instruction is a near (function) return.
1048   eInstructionControlFlowKindReturn,
1049   /// The instruction is a near unconditional jump.
1050   eInstructionControlFlowKindJump,
1051   /// The instruction is a near conditional jump.
1052   eInstructionControlFlowKindCondJump,
1053   /// The instruction is a call-like far transfer.
1054   /// E.g. SYSCALL, SYSENTER, or FAR CALL.
1055   eInstructionControlFlowKindFarCall,
1056   /// The instruction is a return-like far transfer.
1057   /// E.g. SYSRET, SYSEXIT, IRET, or FAR RET.
1058   eInstructionControlFlowKindFarReturn,
1059   /// The instruction is a jump-like far transfer.
1060   /// E.g. FAR JMP.
1061   eInstructionControlFlowKindFarJump
1062 };
1063 
1064 /// Watchpoint Kind.
1065 ///
1066 /// Indicates what types of events cause the watchpoint to fire. Used by Native
1067 /// *Protocol-related classes.
1068 FLAGS_ENUM(WatchpointKind){eWatchpointKindWrite = (1u << 0),
1069                            eWatchpointKindRead = (1u << 1)};
1070 
1071 enum GdbSignal {
1072   eGdbSignalBadAccess = 0x91,
1073   eGdbSignalBadInstruction = 0x92,
1074   eGdbSignalArithmetic = 0x93,
1075   eGdbSignalEmulation = 0x94,
1076   eGdbSignalSoftware = 0x95,
1077   eGdbSignalBreakpoint = 0x96
1078 };
1079 
1080 /// Used with SBHostOS::GetLLDBPath (lldb::PathType) to find files that are
1081 /// related to LLDB on the current host machine. Most files are
1082 /// relative to LLDB or are in known locations.
1083 enum PathType {
1084   ePathTypeLLDBShlibDir, ///< The directory where the lldb.so (unix) or LLDB
1085                          ///< mach-o file in LLDB.framework (MacOSX) exists
1086   ePathTypeSupportExecutableDir, ///< Find LLDB support executable directory
1087                                  ///< (debugserver, etc)
1088   ePathTypeHeaderDir,            ///< Find LLDB header file directory
1089   ePathTypePythonDir,            ///< Find Python modules (PYTHONPATH) directory
1090   ePathTypeLLDBSystemPlugins,    ///< System plug-ins directory
1091   ePathTypeLLDBUserPlugins,      ///< User plug-ins directory
1092   ePathTypeLLDBTempSystemDir, ///< The LLDB temp directory for this system that
1093                               ///< will be cleaned up on exit
1094   ePathTypeGlobalLLDBTempSystemDir, ///< The LLDB temp directory for this
1095                                     ///< system, NOT cleaned up on a process
1096                                     ///< exit.
1097   ePathTypeClangDir ///< Find path to Clang builtin headers
1098 };
1099 
1100 /// Kind of member function.
1101 ///
1102 /// Used by the type system.
1103 enum MemberFunctionKind {
1104   eMemberFunctionKindUnknown = 0,    ///< Not sure what the type of this is
1105   eMemberFunctionKindConstructor,    ///< A function used to create instances
1106   eMemberFunctionKindDestructor,     ///< A function used to tear down existing
1107                                      ///< instances
1108   eMemberFunctionKindInstanceMethod, ///< A function that applies to a specific
1109                                      ///< instance
1110   eMemberFunctionKindStaticMethod ///< A function that applies to a type rather
1111                                   ///< than any instance
1112 };
1113 
1114 /// String matching algorithm used by SBTarget.
1115 enum MatchType {
1116   eMatchTypeNormal,
1117   eMatchTypeRegex,
1118   eMatchTypeStartsWith,
1119   eMatchTypeRegexInsensitive
1120 };
1121 
1122 /// Bitmask that describes details about a type.
1123 FLAGS_ENUM(TypeFlags){
1124     eTypeHasChildren = (1u << 0),       eTypeHasValue = (1u << 1),
1125     eTypeIsArray = (1u << 2),           eTypeIsBlock = (1u << 3),
1126     eTypeIsBuiltIn = (1u << 4),         eTypeIsClass = (1u << 5),
1127     eTypeIsCPlusPlus = (1u << 6),       eTypeIsEnumeration = (1u << 7),
1128     eTypeIsFuncPrototype = (1u << 8),   eTypeIsMember = (1u << 9),
1129     eTypeIsObjC = (1u << 10),           eTypeIsPointer = (1u << 11),
1130     eTypeIsReference = (1u << 12),      eTypeIsStructUnion = (1u << 13),
1131     eTypeIsTemplate = (1u << 14),       eTypeIsTypedef = (1u << 15),
1132     eTypeIsVector = (1u << 16),         eTypeIsScalar = (1u << 17),
1133     eTypeIsInteger = (1u << 18),        eTypeIsFloat = (1u << 19),
1134     eTypeIsComplex = (1u << 20),        eTypeIsSigned = (1u << 21),
1135     eTypeInstanceIsPointer = (1u << 22)};
1136 
1137 FLAGS_ENUM(CommandFlags){
1138     /// eCommandRequiresTarget
1139     ///
1140     /// Ensures a valid target is contained in m_exe_ctx prior to executing the
1141     /// command. If a target doesn't exist or is invalid, the command will fail
1142     /// and CommandObject::GetInvalidTargetDescription() will be returned as the
1143     /// error. CommandObject subclasses can override the virtual function for
1144     /// GetInvalidTargetDescription() to provide custom strings when needed.
1145     eCommandRequiresTarget = (1u << 0),
1146     /// eCommandRequiresProcess
1147     ///
1148     /// Ensures a valid process is contained in m_exe_ctx prior to executing the
1149     /// command. If a process doesn't exist or is invalid, the command will fail
1150     /// and CommandObject::GetInvalidProcessDescription() will be returned as
1151     /// the error. CommandObject subclasses can override the virtual function
1152     /// for GetInvalidProcessDescription() to provide custom strings when
1153     /// needed.
1154     eCommandRequiresProcess = (1u << 1),
1155     /// eCommandRequiresThread
1156     ///
1157     /// Ensures a valid thread is contained in m_exe_ctx prior to executing the
1158     /// command. If a thread doesn't exist or is invalid, the command will fail
1159     /// and CommandObject::GetInvalidThreadDescription() will be returned as the
1160     /// error. CommandObject subclasses can override the virtual function for
1161     /// GetInvalidThreadDescription() to provide custom strings when needed.
1162     eCommandRequiresThread = (1u << 2),
1163     /// eCommandRequiresFrame
1164     ///
1165     /// Ensures a valid frame is contained in m_exe_ctx prior to executing the
1166     /// command. If a frame doesn't exist or is invalid, the command will fail
1167     /// and CommandObject::GetInvalidFrameDescription() will be returned as the
1168     /// error. CommandObject subclasses can override the virtual function for
1169     /// GetInvalidFrameDescription() to provide custom strings when needed.
1170     eCommandRequiresFrame = (1u << 3),
1171     /// eCommandRequiresRegContext
1172     ///
1173     /// Ensures a valid register context (from the selected frame if there is a
1174     /// frame in m_exe_ctx, or from the selected thread from m_exe_ctx) is
1175     /// available from m_exe_ctx prior to executing the command. If a target
1176     /// doesn't exist or is invalid, the command will fail and
1177     /// CommandObject::GetInvalidRegContextDescription() will be returned as the
1178     /// error. CommandObject subclasses can override the virtual function for
1179     /// GetInvalidRegContextDescription() to provide custom strings when needed.
1180     eCommandRequiresRegContext = (1u << 4),
1181     /// eCommandTryTargetAPILock
1182     ///
1183     /// Attempts to acquire the target lock if a target is selected in the
1184     /// command interpreter. If the command object fails to acquire the API
1185     /// lock, the command will fail with an appropriate error message.
1186     eCommandTryTargetAPILock = (1u << 5),
1187     /// eCommandProcessMustBeLaunched
1188     ///
1189     /// Verifies that there is a launched process in m_exe_ctx, if there isn't,
1190     /// the command will fail with an appropriate error message.
1191     eCommandProcessMustBeLaunched = (1u << 6),
1192     /// eCommandProcessMustBePaused
1193     ///
1194     /// Verifies that there is a paused process in m_exe_ctx, if there isn't,
1195     /// the command will fail with an appropriate error message.
1196     eCommandProcessMustBePaused = (1u << 7),
1197     /// eCommandProcessMustBeTraced
1198     ///
1199     /// Verifies that the process is being traced by a Trace plug-in, if it
1200     /// isn't the command will fail with an appropriate error message.
1201     eCommandProcessMustBeTraced = (1u << 8)};
1202 
1203 /// Whether a summary should cap how much data it returns to users or not.
1204 enum TypeSummaryCapping {
1205   eTypeSummaryCapped = true,
1206   eTypeSummaryUncapped = false
1207 };
1208 
1209 /// The result from a command interpreter run.
1210 enum CommandInterpreterResult {
1211   /// Command interpreter finished successfully.
1212   eCommandInterpreterResultSuccess,
1213   /// Stopped because the corresponding option was set and the inferior
1214   /// crashed.
1215   eCommandInterpreterResultInferiorCrash,
1216   /// Stopped because the corresponding option was set and a command returned
1217   /// an error.
1218   eCommandInterpreterResultCommandError,
1219   /// Stopped because quit was requested.
1220   eCommandInterpreterResultQuitRequested,
1221 };
1222 
1223 // Style of core file to create when calling SaveCore.
1224 enum SaveCoreStyle {
1225   eSaveCoreUnspecified = 0,
1226   eSaveCoreFull = 1,
1227   eSaveCoreDirtyOnly = 2,
1228   eSaveCoreStackOnly = 3,
1229   eSaveCoreCustomOnly = 4,
1230 };
1231 
1232 /// Events that might happen during a trace session.
1233 enum TraceEvent {
1234   /// Tracing was disabled for some time due to a software trigger.
1235   eTraceEventDisabledSW,
1236   /// Tracing was disable for some time due to a hardware trigger.
1237   eTraceEventDisabledHW,
1238   /// Event due to CPU change for a thread. This event is also fired when
1239   /// suddenly it's not possible to identify the cpu of a given thread.
1240   eTraceEventCPUChanged,
1241   /// Event due to a CPU HW clock tick.
1242   eTraceEventHWClockTick,
1243   /// The underlying tracing technology emitted a synchronization event used by
1244   /// trace processors.
1245   eTraceEventSyncPoint,
1246 };
1247 
1248 // Enum used to identify which kind of item a \a TraceCursor is pointing at
1249 enum TraceItemKind {
1250   eTraceItemKindError = 0,
1251   eTraceItemKindEvent,
1252   eTraceItemKindInstruction,
1253 };
1254 
1255 /// Enum to indicate the reference point when invoking
1256 /// \a TraceCursor::Seek().
1257 /// The following values are inspired by \a std::istream::seekg.
1258 enum TraceCursorSeekType {
1259   /// The beginning of the trace, i.e the oldest item.
1260   eTraceCursorSeekTypeBeginning = 0,
1261   /// The current position in the trace.
1262   eTraceCursorSeekTypeCurrent,
1263   /// The end of the trace, i.e the most recent item.
1264   eTraceCursorSeekTypeEnd
1265 };
1266 
1267 /// Enum to control the verbosity level of `dwim-print` execution.
1268 enum DWIMPrintVerbosity {
1269   /// Run `dwim-print` with no verbosity.
1270   eDWIMPrintVerbosityNone,
1271   /// Print a message when `dwim-print` uses `expression` evaluation.
1272   eDWIMPrintVerbosityExpression,
1273   /// Always print a message indicating how `dwim-print` is evaluating its
1274   /// expression.
1275   eDWIMPrintVerbosityFull,
1276 };
1277 
1278 enum WatchpointValueKind {
1279   eWatchPointValueKindInvalid = 0,
1280   ///< Watchpoint was created watching a variable
1281   eWatchPointValueKindVariable = 1,
1282   ///< Watchpoint was created watching the result of an expression that was
1283   ///< evaluated at creation time.
1284   eWatchPointValueKindExpression = 2,
1285 };
1286 
1287 enum CompletionType {
1288   eNoCompletion = 0ul,
1289   eSourceFileCompletion = (1ul << 0),
1290   eDiskFileCompletion = (1ul << 1),
1291   eDiskDirectoryCompletion = (1ul << 2),
1292   eSymbolCompletion = (1ul << 3),
1293   eModuleCompletion = (1ul << 4),
1294   eSettingsNameCompletion = (1ul << 5),
1295   ePlatformPluginCompletion = (1ul << 6),
1296   eArchitectureCompletion = (1ul << 7),
1297   eVariablePathCompletion = (1ul << 8),
1298   eRegisterCompletion = (1ul << 9),
1299   eBreakpointCompletion = (1ul << 10),
1300   eProcessPluginCompletion = (1ul << 11),
1301   eDisassemblyFlavorCompletion = (1ul << 12),
1302   eTypeLanguageCompletion = (1ul << 13),
1303   eFrameIndexCompletion = (1ul << 14),
1304   eModuleUUIDCompletion = (1ul << 15),
1305   eStopHookIDCompletion = (1ul << 16),
1306   eThreadIndexCompletion = (1ul << 17),
1307   eWatchpointIDCompletion = (1ul << 18),
1308   eBreakpointNameCompletion = (1ul << 19),
1309   eProcessIDCompletion = (1ul << 20),
1310   eProcessNameCompletion = (1ul << 21),
1311   eRemoteDiskFileCompletion = (1ul << 22),
1312   eRemoteDiskDirectoryCompletion = (1ul << 23),
1313   eTypeCategoryNameCompletion = (1ul << 24),
1314   eCustomCompletion = (1ul << 25),
1315   eThreadIDCompletion = (1ul << 26),
1316   // This last enum element is just for input validation.
1317   // Add new completions before this element,
1318   // and then increment eTerminatorCompletion's shift value
1319   eTerminatorCompletion = (1ul << 27)
1320 };
1321 
1322 /// Specifies if children need to be re-computed
1323 /// after a call to \ref SyntheticChildrenFrontEnd::Update.
1324 enum ChildCacheState {
1325   eRefetch = 0, ///< Children need to be recomputed dynamically.
1326 
1327   eReuse = 1, ///< Children did not change and don't need to be recomputed;
1328               ///< re-use what we computed the last time we called Update.
1329 };
1330 
1331 enum SymbolDownload {
1332   eSymbolDownloadOff = 0,
1333   eSymbolDownloadBackground = 1,
1334   eSymbolDownloadForeground = 2,
1335 };
1336 
1337 /// Used in the SBProcess AddressMask/FixAddress methods.
1338 enum AddressMaskType {
1339   eAddressMaskTypeCode = 0,
1340   eAddressMaskTypeData,
1341   eAddressMaskTypeAny,
1342   eAddressMaskTypeAll = eAddressMaskTypeAny
1343 };
1344 
1345 /// Used in the SBProcess AddressMask/FixAddress methods.
1346 enum AddressMaskRange {
1347   eAddressMaskRangeLow = 0,
1348   eAddressMaskRangeHigh,
1349   eAddressMaskRangeAny,
1350   eAddressMaskRangeAll = eAddressMaskRangeAny,
1351 };
1352 
1353 /// Used by the debugger to indicate which events are being broadcasted.
1354 enum DebuggerBroadcastBit {
1355   eBroadcastBitProgress = (1 << 0),
1356   eBroadcastBitWarning = (1 << 1),
1357   eBroadcastBitError = (1 << 2),
1358   eBroadcastSymbolChange = (1 << 3),
1359   eBroadcastBitProgressCategory = (1 << 4),
1360   eBroadcastBitExternalProgress = (1 << 5),
1361   eBroadcastBitExternalProgressCategory = (1 << 6),
1362 };
1363 
1364 /// Used for expressing severity in logs and diagnostics.
1365 enum Severity {
1366   eSeverityError,
1367   eSeverityWarning,
1368   eSeverityInfo, // Equivalent to Remark used in clang.
1369 };
1370 
1371 } // namespace lldb
1372 
1373 #endif // LLDB_LLDB_ENUMERATIONS_H
1374