1 //===-- lldb-enumerations.h -------------------------------------*- C++ -*-===//
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
7 //===----------------------------------------------------------------------===//
9 #ifndef LLDB_lldb_enumerations_h_
10 #define LLDB_lldb_enumerations_h_
12 #include <type_traits>
15 // Macro to enable bitmask operations on an enum. Without this, Enum | Enum
16 // gets promoted to an int, so you have to say Enum a = Enum(eFoo | eBar). If
17 // you mark Enum with LLDB_MARK_AS_BITMASK_ENUM(Enum), however, you can simply
18 // write Enum a = eFoo | eBar.
19 // Unfortunately, swig<3.0 doesn't recognise the constexpr keyword, so remove
20 // this entire block, as it is not necessary for swig processing.
21 #define LLDB_MARK_AS_BITMASK_ENUM(Enum) \
22 constexpr Enum operator|(Enum a, Enum b) { \
23 return static_cast<Enum>( \
24 static_cast<std::underlying_type<Enum>::type>(a) | \
25 static_cast<std::underlying_type<Enum>::type>(b)); \
27 constexpr Enum operator&(Enum a, Enum b) { \
28 return static_cast<Enum>( \
29 static_cast<std::underlying_type<Enum>::type>(a) & \
30 static_cast<std::underlying_type<Enum>::type>(b)); \
32 constexpr Enum operator~(Enum a) { \
33 return static_cast<Enum>( \
34 ~static_cast<std::underlying_type<Enum>::type>(a)); \
36 inline Enum &operator|=(Enum &a, Enum b) { \
40 inline Enum &operator&=(Enum &a, Enum b) { \
45 #define LLDB_MARK_AS_BITMASK_ENUM(Enum)
49 // With MSVC, the default type of an enum is always signed, even if one of the
50 // enumerator values is too large to fit into a signed integer but would
51 // otherwise fit into an unsigned integer. As a result of this, all of LLDB's
52 // flag-style enumerations that specify something like eValueFoo = 1u << 31
53 // result in negative values. This usually just results in a benign warning,
54 // but in a few places we actually do comparisons on the enum values, which
55 // would cause a real bug. Furthermore, there's no way to silence only this
56 // warning, as it's part of -Wmicrosoft which also catches a whole slew of
57 // other useful issues.
59 // To make matters worse, early versions of SWIG don't recognize the syntax of
60 // specifying the underlying type of an enum (and Python doesn't care anyway)
61 // so we need a way to specify the underlying type when the enum is being used
62 // from C++ code, but just use a regular enum when swig is pre-processing.
63 #define FLAGS_ENUM(Name) enum Name : unsigned
64 #define FLAGS_ANONYMOUS_ENUM() enum : unsigned
66 #define FLAGS_ENUM(Name) enum Name
67 #define FLAGS_ANONYMOUS_ENUM() enum
72 /// Process and Thread States.
75 eStateUnloaded, ///< Process is object is valid, but not currently loaded
76 eStateConnected, ///< Process is connected to remote debug services, but not
77 /// launched or attached to anything yet
78 eStateAttaching, ///< Process is currently trying to attach
79 eStateLaunching, ///< Process is in the process of launching
80 // The state changes eStateAttaching and eStateLaunching are both sent while
81 // the private state thread is either not yet started or paused. For that
82 // reason, they should only be signaled as public state changes, and not
83 // private state changes.
84 eStateStopped, ///< Process or thread is stopped and can be examined.
85 eStateRunning, ///< Process or thread is running and can't be examined.
86 eStateStepping, ///< Process or thread is in the process of stepping and can
88 eStateCrashed, ///< Process or thread has crashed and can be examined.
89 eStateDetached, ///< Process has been detached and can't be examined.
90 eStateExited, ///< Process has exited and can't be examined.
91 eStateSuspended, ///< Process or thread is in a suspended state as far
92 ///< as the debugger is concerned while other processes
93 ///< or threads get the chance to run.
94 kLastStateType = eStateSuspended
98 FLAGS_ENUM(LaunchFlags){
100 eLaunchFlagExec = (1u << 0), ///< Exec when launching and turn the calling
101 /// process into a new process
102 eLaunchFlagDebug = (1u << 1), ///< Stop as soon as the process launches to
103 /// allow the process to be debugged
104 eLaunchFlagStopAtEntry = (1u
105 << 2), ///< Stop at the program entry point
106 /// instead of auto-continuing when
107 /// launching or attaching at entry point
108 eLaunchFlagDisableASLR =
109 (1u << 3), ///< Disable Address Space Layout Randomization
110 eLaunchFlagDisableSTDIO =
111 (1u << 4), ///< Disable stdio for inferior process (e.g. for a GUI app)
112 eLaunchFlagLaunchInTTY =
113 (1u << 5), ///< Launch the process in a new TTY if supported by the host
114 eLaunchFlagLaunchInShell =
115 (1u << 6), ///< Launch the process inside a shell to get shell expansion
116 eLaunchFlagLaunchInSeparateProcessGroup =
117 (1u << 7), ///< Launch the process in a separate process group
118 ///< If you are going to hand the process off (e.g. to
120 eLaunchFlagDontSetExitStatus = (1u << 8),
121 ///< set this flag so lldb & the handee don't race to set its exit status.
122 eLaunchFlagDetachOnError = (1u << 9), ///< If set, then the client stub
123 ///< should detach rather than killing
125 ///< if it loses connection with lldb.
126 eLaunchFlagShellExpandArguments =
127 (1u << 10), ///< Perform shell-style argument expansion
128 eLaunchFlagCloseTTYOnExit = (1u << 11), ///< Close the open TTY on exit
131 /// Thread Run Modes.
132 enum RunMode { eOnlyThisThread, eAllThreads, eOnlyDuringStepping };
134 /// Byte ordering definitions.
136 eByteOrderInvalid = 0,
142 /// Register encoding definitions.
144 eEncodingInvalid = 0,
145 eEncodingUint, ///< unsigned integer
146 eEncodingSint, ///< signed integer
147 eEncodingIEEE754, ///< float
148 eEncodingVector ///< vector registers
151 /// Display format definitions.
158 eFormatBytesWithASCII,
160 eFormatCharPrintable, ///< Only printable characters, space if not printable
161 eFormatComplex, ///< Floating point complex type
162 eFormatComplexFloat = eFormatComplex,
163 eFormatCString, ///< NULL terminated C strings
170 eFormatOSType, ///< OS character codes encoded into an integer 'PICT' 'text'
177 eFormatVectorOfSInt8,
178 eFormatVectorOfUInt8,
179 eFormatVectorOfSInt16,
180 eFormatVectorOfUInt16,
181 eFormatVectorOfSInt32,
182 eFormatVectorOfUInt32,
183 eFormatVectorOfSInt64,
184 eFormatVectorOfUInt64,
185 eFormatVectorOfFloat16,
186 eFormatVectorOfFloat32,
187 eFormatVectorOfFloat64,
188 eFormatVectorOfUInt128,
189 eFormatComplexInteger, ///< Integer complex type
190 eFormatCharArray, ///< Print characters with no single quotes, used for
191 ///< character arrays that can contain non printable
193 eFormatAddressInfo, ///< Describe what an address points to (func + offset
194 ///< with file/line, symbol + offset, data, etc)
195 eFormatHexFloat, ///< ISO C99 hex float string
196 eFormatInstruction, ///< Disassemble an opcode
197 eFormatVoid, ///< Do not print this
202 /// Description levels for "void GetDescription(Stream *, DescriptionLevel)"
204 enum DescriptionLevel {
205 eDescriptionLevelBrief = 0,
206 eDescriptionLevelFull,
207 eDescriptionLevelVerbose,
208 eDescriptionLevelInitial,
209 kNumDescriptionLevels
212 /// Script interpreter types.
213 enum ScriptLanguage {
214 eScriptLanguageNone = 0,
215 eScriptLanguagePython,
217 eScriptLanguageUnknown,
218 eScriptLanguageDefault = eScriptLanguageLua
221 /// Register numbering types.
222 // See RegisterContext::ConvertRegisterKindToRegisterNumber to convert any of
223 // these to the lldb internal register numbering scheme (eRegisterKindLLDB).
225 eRegisterKindEHFrame = 0, ///< the register numbers seen in eh_frame
226 eRegisterKindDWARF, ///< the register numbers seen DWARF
227 eRegisterKindGeneric, ///< insn ptr reg, stack ptr reg, etc not specific to
228 ///< any particular target
229 eRegisterKindProcessPlugin, ///< num used by the process plugin - e.g. by the
230 ///< remote gdb-protocol stub program
231 eRegisterKindLLDB, ///< lldb's internal register numbers
235 /// Thread stop reasons.
237 eStopReasonInvalid = 0,
240 eStopReasonBreakpoint,
241 eStopReasonWatchpoint,
243 eStopReasonException,
244 eStopReasonExec, ///< Program was re-exec'ed
245 eStopReasonPlanComplete,
246 eStopReasonThreadExiting,
247 eStopReasonInstrumentation
250 /// Command Return Status Types.
252 eReturnStatusInvalid,
253 eReturnStatusSuccessFinishNoResult,
254 eReturnStatusSuccessFinishResult,
255 eReturnStatusSuccessContinuingNoResult,
256 eReturnStatusSuccessContinuingResult,
257 eReturnStatusStarted,
262 /// The results of expression evaluation.
263 enum ExpressionResults {
264 eExpressionCompleted = 0,
265 eExpressionSetupError,
266 eExpressionParseError,
267 eExpressionDiscarded,
268 eExpressionInterrupted,
269 eExpressionHitBreakpoint,
271 eExpressionResultUnavailable,
272 eExpressionStoppedForDebug
276 eSearchDepthInvalid = 0,
279 eSearchDepthCompUnit,
280 eSearchDepthFunction,
283 kLastSearchDepthKind = eSearchDepthAddress
286 /// Connection Status Types.
287 enum ConnectionStatus {
288 eConnectionStatusSuccess, ///< Success
289 eConnectionStatusEndOfFile, ///< End-of-file encountered
290 eConnectionStatusError, ///< Check GetError() for details
291 eConnectionStatusTimedOut, ///< Request timed out
292 eConnectionStatusNoConnection, ///< No connection
293 eConnectionStatusLostConnection, ///< Lost connection while connected to a
294 ///< valid connection
295 eConnectionStatusInterrupted ///< Interrupted read
300 eErrorTypeGeneric, ///< Generic errors that can be any value.
301 eErrorTypeMachKernel, ///< Mach kernel error codes.
302 eErrorTypePOSIX, ///< POSIX error codes.
303 eErrorTypeExpression, ///< These are from the ExpressionResults enum.
304 eErrorTypeWin32 ///< Standard Win32 error codes.
308 eValueTypeInvalid = 0,
309 eValueTypeVariableGlobal = 1, ///< globals variable
310 eValueTypeVariableStatic = 2, ///< static variable
311 eValueTypeVariableArgument = 3, ///< function argument variables
312 eValueTypeVariableLocal = 4, ///< function local variables
313 eValueTypeRegister = 5, ///< stack frame register value
314 eValueTypeRegisterSet = 6, ///< A collection of stack frame register values
315 eValueTypeConstResult = 7, ///< constant result variables
316 eValueTypeVariableThreadLocal = 8 ///< thread local storage variable
319 /// Token size/granularities for Input Readers.
321 enum InputReaderGranularity {
322 eInputReaderGranularityInvalid = 0,
323 eInputReaderGranularityByte,
324 eInputReaderGranularityWord,
325 eInputReaderGranularityLine,
326 eInputReaderGranularityAll
329 /// These mask bits allow a common interface for queries that can
330 /// limit the amount of information that gets parsed to only the
331 /// information that is requested. These bits also can indicate what
332 /// actually did get resolved during query function calls.
334 /// Each definition corresponds to a one of the member variables
335 /// in this class, and requests that that item be resolved, or
336 /// indicates that the member did get resolved.
337 FLAGS_ENUM(SymbolContextItem){
338 /// Set when \a target is requested from a query, or was located
340 eSymbolContextTarget = (1u << 0),
341 /// Set when \a module is requested from a query, or was located
343 eSymbolContextModule = (1u << 1),
344 /// Set when \a comp_unit is requested from a query, or was
345 /// located in query results
346 eSymbolContextCompUnit = (1u << 2),
347 /// Set when \a function is requested from a query, or was located
349 eSymbolContextFunction = (1u << 3),
350 /// Set when the deepest \a block is requested from a query, or
351 /// was located in query results
352 eSymbolContextBlock = (1u << 4),
353 /// Set when \a line_entry is requested from a query, or was
354 /// located in query results
355 eSymbolContextLineEntry = (1u << 5),
356 /// Set when \a symbol is requested from a query, or was located
358 eSymbolContextSymbol = (1u << 6),
359 /// Indicates to try and lookup everything up during a routine
360 /// symbol context query.
361 eSymbolContextEverything = ((eSymbolContextSymbol << 1) - 1u),
362 /// Set when \a global or static variable is requested from a
363 /// query, or was located in query results.
364 /// eSymbolContextVariable is potentially expensive to lookup so
365 /// it isn't included in eSymbolContextEverything which stops it
366 /// from being used during frame PC lookups and many other
367 /// potential address to symbol context lookups.
368 eSymbolContextVariable = (1u << 7),
370 LLDB_MARK_AS_BITMASK_ENUM(SymbolContextItem)
372 FLAGS_ENUM(Permissions){ePermissionsWritable = (1u << 0),
373 ePermissionsReadable = (1u << 1),
374 ePermissionsExecutable = (1u << 2)};
375 LLDB_MARK_AS_BITMASK_ENUM(Permissions)
377 enum InputReaderAction {
378 eInputReaderActivate, ///< reader is newly pushed onto the reader stack
379 eInputReaderAsynchronousOutputWritten, ///< an async output event occurred;
380 ///< the reader may want to do
382 eInputReaderReactivate, ///< reader is on top of the stack again after another
383 ///< reader was popped off
384 eInputReaderDeactivate, ///< another reader was pushed on the stack
385 eInputReaderGotToken, ///< reader got one of its tokens (granularity)
386 eInputReaderInterrupt, ///< reader received an interrupt signal (probably from
388 eInputReaderEndOfFile, ///< reader received an EOF char (probably from a
390 eInputReaderDone ///< reader was just popped off the stack and is done
393 FLAGS_ENUM(BreakpointEventType){
394 eBreakpointEventTypeInvalidType = (1u << 0),
395 eBreakpointEventTypeAdded = (1u << 1),
396 eBreakpointEventTypeRemoved = (1u << 2),
397 eBreakpointEventTypeLocationsAdded = (1u << 3), ///< Locations added doesn't
398 ///< get sent when the
399 ///< breakpoint is created
400 eBreakpointEventTypeLocationsRemoved = (1u << 4),
401 eBreakpointEventTypeLocationsResolved = (1u << 5),
402 eBreakpointEventTypeEnabled = (1u << 6),
403 eBreakpointEventTypeDisabled = (1u << 7),
404 eBreakpointEventTypeCommandChanged = (1u << 8),
405 eBreakpointEventTypeConditionChanged = (1u << 9),
406 eBreakpointEventTypeIgnoreChanged = (1u << 10),
407 eBreakpointEventTypeThreadChanged = (1u << 11),
408 eBreakpointEventTypeAutoContinueChanged = (1u << 12)};
410 FLAGS_ENUM(WatchpointEventType){
411 eWatchpointEventTypeInvalidType = (1u << 0),
412 eWatchpointEventTypeAdded = (1u << 1),
413 eWatchpointEventTypeRemoved = (1u << 2),
414 eWatchpointEventTypeEnabled = (1u << 6),
415 eWatchpointEventTypeDisabled = (1u << 7),
416 eWatchpointEventTypeCommandChanged = (1u << 8),
417 eWatchpointEventTypeConditionChanged = (1u << 9),
418 eWatchpointEventTypeIgnoreChanged = (1u << 10),
419 eWatchpointEventTypeThreadChanged = (1u << 11),
420 eWatchpointEventTypeTypeChanged = (1u << 12)};
422 /// Programming language type.
424 /// These enumerations use the same language enumerations as the DWARF
425 /// specification for ease of use and consistency.
426 /// The enum -> string code is in Language.cpp, don't change this
427 /// table without updating that code as well.
429 eLanguageTypeUnknown = 0x0000, ///< Unknown or invalid language value.
430 eLanguageTypeC89 = 0x0001, ///< ISO C:1989.
431 eLanguageTypeC = 0x0002, ///< Non-standardized C, such as K&R.
432 eLanguageTypeAda83 = 0x0003, ///< ISO Ada:1983.
433 eLanguageTypeC_plus_plus = 0x0004, ///< ISO C++:1998.
434 eLanguageTypeCobol74 = 0x0005, ///< ISO Cobol:1974.
435 eLanguageTypeCobol85 = 0x0006, ///< ISO Cobol:1985.
436 eLanguageTypeFortran77 = 0x0007, ///< ISO Fortran 77.
437 eLanguageTypeFortran90 = 0x0008, ///< ISO Fortran 90.
438 eLanguageTypePascal83 = 0x0009, ///< ISO Pascal:1983.
439 eLanguageTypeModula2 = 0x000a, ///< ISO Modula-2:1996.
440 eLanguageTypeJava = 0x000b, ///< Java.
441 eLanguageTypeC99 = 0x000c, ///< ISO C:1999.
442 eLanguageTypeAda95 = 0x000d, ///< ISO Ada:1995.
443 eLanguageTypeFortran95 = 0x000e, ///< ISO Fortran 95.
444 eLanguageTypePLI = 0x000f, ///< ANSI PL/I:1976.
445 eLanguageTypeObjC = 0x0010, ///< Objective-C.
446 eLanguageTypeObjC_plus_plus = 0x0011, ///< Objective-C++.
447 eLanguageTypeUPC = 0x0012, ///< Unified Parallel C.
448 eLanguageTypeD = 0x0013, ///< D.
449 eLanguageTypePython = 0x0014, ///< Python.
450 // NOTE: The below are DWARF5 constants, subject to change upon
451 // completion of the DWARF5 specification
452 eLanguageTypeOpenCL = 0x0015, ///< OpenCL.
453 eLanguageTypeGo = 0x0016, ///< Go.
454 eLanguageTypeModula3 = 0x0017, ///< Modula 3.
455 eLanguageTypeHaskell = 0x0018, ///< Haskell.
456 eLanguageTypeC_plus_plus_03 = 0x0019, ///< ISO C++:2003.
457 eLanguageTypeC_plus_plus_11 = 0x001a, ///< ISO C++:2011.
458 eLanguageTypeOCaml = 0x001b, ///< OCaml.
459 eLanguageTypeRust = 0x001c, ///< Rust.
460 eLanguageTypeC11 = 0x001d, ///< ISO C:2011.
461 eLanguageTypeSwift = 0x001e, ///< Swift.
462 eLanguageTypeJulia = 0x001f, ///< Julia.
463 eLanguageTypeDylan = 0x0020, ///< Dylan.
464 eLanguageTypeC_plus_plus_14 = 0x0021, ///< ISO C++:2014.
465 eLanguageTypeFortran03 = 0x0022, ///< ISO Fortran 2003.
466 eLanguageTypeFortran08 = 0x0023, ///< ISO Fortran 2008.
468 // Note: Language::GetNameForLanguageType
469 // assumes these can be used as indexes into array language_names, and
470 // Language::SetLanguageFromCString and Language::AsCString assume these can
471 // be used as indexes into array g_languages.
472 eLanguageTypeMipsAssembler = 0x0024, ///< Mips_Assembler.
473 eLanguageTypeExtRenderScript = 0x0025, ///< RenderScript.
477 enum InstrumentationRuntimeType {
478 eInstrumentationRuntimeTypeAddressSanitizer = 0x0000,
479 eInstrumentationRuntimeTypeThreadSanitizer = 0x0001,
480 eInstrumentationRuntimeTypeUndefinedBehaviorSanitizer = 0x0002,
481 eInstrumentationRuntimeTypeMainThreadChecker = 0x0003,
482 eInstrumentationRuntimeTypeSwiftRuntimeReporting = 0x0004,
483 eNumInstrumentationRuntimeTypes
486 enum DynamicValueType {
487 eNoDynamicValues = 0,
488 eDynamicCanRunTarget = 1,
489 eDynamicDontRunTarget = 2
492 enum StopShowColumn {
493 eStopShowColumnAnsiOrCaret = 0,
494 eStopShowColumnAnsi = 1,
495 eStopShowColumnCaret = 2,
496 eStopShowColumnNone = 3
507 enum CommandArgumentType {
509 eArgTypeAddressOrExpression,
511 eArgTypeAliasOptions,
512 eArgTypeArchitecture,
514 eArgTypeBreakpointID,
515 eArgTypeBreakpointIDRange,
516 eArgTypeBreakpointName,
521 eArgTypeDescriptionVerbosity,
522 eArgTypeDirectoryName,
523 eArgTypeDisassemblyFlavor,
526 eArgTypeExpressionPath,
532 eArgTypeFunctionName,
533 eArgTypeFunctionOrSymbol,
543 eArgTypeNewPathPrefix,
545 eArgTypeNumberPerLine,
547 eArgTypeOldPathPrefix,
550 eArgTypePermissionsNumber,
551 eArgTypePermissionsString,
556 eArgTypePythonFunction,
557 eArgTypePythonScript,
559 eArgTypeRegisterName,
560 eArgTypeRegularExpression,
563 eArgTypeScriptedCommandSynchronicity,
567 eArgTypeSettingIndex,
569 eArgTypeSettingPrefix,
570 eArgTypeSettingVariableName,
574 eArgTypeStartAddress,
575 eArgTypeSummaryString,
581 eArgTypeUnsignedInteger,
588 eArgTypeWatchpointID,
589 eArgTypeWatchpointIDRange,
593 eArgTypeLastArg // Always keep this entry as the last entry in this
598 // Symbol holds the SymbolType in a 6-bit field (m_type), so if you get over 63
599 // entries you will have to resize that field.
602 eSymbolTypeInvalid = 0,
607 eSymbolTypeTrampoline,
609 eSymbolTypeException,
610 eSymbolTypeSourceFile,
611 eSymbolTypeHeaderFile,
612 eSymbolTypeObjectFile,
613 eSymbolTypeCommonBlock,
618 eSymbolTypeVariableType,
619 eSymbolTypeLineEntry,
620 eSymbolTypeLineHeader,
621 eSymbolTypeScopeBegin,
623 eSymbolTypeAdditional, ///< When symbols take more than one entry, the extra
624 ///< entries get this type
626 eSymbolTypeInstrumentation,
627 eSymbolTypeUndefined,
628 eSymbolTypeObjCClass,
629 eSymbolTypeObjCMetaClass,
631 eSymbolTypeReExported
637 eSectionTypeContainer, ///< The section contains child sections
639 eSectionTypeDataCString, ///< Inlined C string data
640 eSectionTypeDataCStringPointers, ///< Pointers to C string data
641 eSectionTypeDataSymbolAddress, ///< Address of a symbol in the symbol table
645 eSectionTypeDataPointers,
647 eSectionTypeZeroFill,
648 eSectionTypeDataObjCMessageRefs, ///< Pointer to function pointer + selector
649 eSectionTypeDataObjCCFStrings, ///< Objective-C const CFString/NSString
651 eSectionTypeDWARFDebugAbbrev,
652 eSectionTypeDWARFDebugAddr,
653 eSectionTypeDWARFDebugAranges,
654 eSectionTypeDWARFDebugCuIndex,
655 eSectionTypeDWARFDebugFrame,
656 eSectionTypeDWARFDebugInfo,
657 eSectionTypeDWARFDebugLine,
658 eSectionTypeDWARFDebugLoc,
659 eSectionTypeDWARFDebugMacInfo,
660 eSectionTypeDWARFDebugMacro,
661 eSectionTypeDWARFDebugPubNames,
662 eSectionTypeDWARFDebugPubTypes,
663 eSectionTypeDWARFDebugRanges,
664 eSectionTypeDWARFDebugStr,
665 eSectionTypeDWARFDebugStrOffsets,
666 eSectionTypeDWARFAppleNames,
667 eSectionTypeDWARFAppleTypes,
668 eSectionTypeDWARFAppleNamespaces,
669 eSectionTypeDWARFAppleObjC,
670 eSectionTypeELFSymbolTable, ///< Elf SHT_SYMTAB section
671 eSectionTypeELFDynamicSymbols, ///< Elf SHT_DYNSYM section
672 eSectionTypeELFRelocationEntries, ///< Elf SHT_REL or SHT_REL section
673 eSectionTypeELFDynamicLinkInfo, ///< Elf SHT_DYNAMIC section
675 eSectionTypeARMexidx,
676 eSectionTypeARMextab,
677 eSectionTypeCompactUnwind, ///< compact unwind section in Mach-O,
678 ///< __TEXT,__unwind_info
679 eSectionTypeGoSymtab,
680 eSectionTypeAbsoluteAddress, ///< Dummy section for symbols with absolute
682 eSectionTypeDWARFGNUDebugAltLink,
683 eSectionTypeDWARFDebugTypes, ///< DWARF .debug_types section
684 eSectionTypeDWARFDebugNames, ///< DWARF v5 .debug_names
686 eSectionTypeDWARFDebugLineStr, ///< DWARF v5 .debug_line_str
687 eSectionTypeDWARFDebugRngLists, ///< DWARF v5 .debug_rnglists
688 eSectionTypeDWARFDebugLocLists, ///< DWARF v5 .debug_loclists
689 eSectionTypeDWARFDebugAbbrevDwo,
690 eSectionTypeDWARFDebugInfoDwo,
691 eSectionTypeDWARFDebugStrDwo,
692 eSectionTypeDWARFDebugStrOffsetsDwo,
693 eSectionTypeDWARFDebugTypesDwo,
694 eSectionTypeDWARFDebugRngListsDwo,
695 eSectionTypeDWARFDebugLocDwo,
696 eSectionTypeDWARFDebugLocListsDwo,
699 FLAGS_ENUM(EmulateInstructionOptions){
700 eEmulateInstructionOptionNone = (0u),
701 eEmulateInstructionOptionAutoAdvancePC = (1u << 0),
702 eEmulateInstructionOptionIgnoreConditions = (1u << 1)};
704 FLAGS_ENUM(FunctionNameType){
705 eFunctionNameTypeNone = 0u,
706 eFunctionNameTypeAuto =
707 (1u << 1), ///< Automatically figure out which FunctionNameType
708 ///< bits to set based on the function name.
709 eFunctionNameTypeFull = (1u << 2), ///< The function name.
710 ///< For C this is the same as just the name of the function For C++ this is
711 ///< the mangled or demangled version of the mangled name. For ObjC this is
712 ///< the full function signature with the + or - and the square brackets and
713 ///< the class and selector
714 eFunctionNameTypeBase = (1u
715 << 3), ///< The function name only, no namespaces
716 ///< or arguments and no class
717 ///< methods or selectors will be searched.
718 eFunctionNameTypeMethod = (1u << 4), ///< Find function by method name (C++)
719 ///< with no namespace or arguments
720 eFunctionNameTypeSelector =
721 (1u << 5), ///< Find function by selector name (ObjC) names
722 eFunctionNameTypeAny =
723 eFunctionNameTypeAuto ///< DEPRECATED: use eFunctionNameTypeAuto
725 LLDB_MARK_AS_BITMASK_ENUM(FunctionNameType)
727 /// Basic types enumeration for the public API SBType::GetBasicType().
729 eBasicTypeInvalid = 0,
732 eBasicTypeSignedChar,
733 eBasicTypeUnsignedChar,
735 eBasicTypeSignedWChar,
736 eBasicTypeUnsignedWChar,
740 eBasicTypeUnsignedShort,
742 eBasicTypeUnsignedInt,
744 eBasicTypeUnsignedLong,
746 eBasicTypeUnsignedLongLong,
748 eBasicTypeUnsignedInt128,
753 eBasicTypeLongDouble,
754 eBasicTypeFloatComplex,
755 eBasicTypeDoubleComplex,
756 eBasicTypeLongDoubleComplex,
767 // Hardware Trace generated by the processor.
768 eTraceTypeProcessorTrace
771 enum StructuredDataType {
772 eStructuredDataTypeInvalid = -1,
773 eStructuredDataTypeNull = 0,
774 eStructuredDataTypeGeneric,
775 eStructuredDataTypeArray,
776 eStructuredDataTypeInteger,
777 eStructuredDataTypeFloat,
778 eStructuredDataTypeBoolean,
779 eStructuredDataTypeString,
780 eStructuredDataTypeDictionary
783 FLAGS_ENUM(TypeClass){
784 eTypeClassInvalid = (0u), eTypeClassArray = (1u << 0),
785 eTypeClassBlockPointer = (1u << 1), eTypeClassBuiltin = (1u << 2),
786 eTypeClassClass = (1u << 3), eTypeClassComplexFloat = (1u << 4),
787 eTypeClassComplexInteger = (1u << 5), eTypeClassEnumeration = (1u << 6),
788 eTypeClassFunction = (1u << 7), eTypeClassMemberPointer = (1u << 8),
789 eTypeClassObjCObject = (1u << 9), eTypeClassObjCInterface = (1u << 10),
790 eTypeClassObjCObjectPointer = (1u << 11), eTypeClassPointer = (1u << 12),
791 eTypeClassReference = (1u << 13), eTypeClassStruct = (1u << 14),
792 eTypeClassTypedef = (1u << 15), eTypeClassUnion = (1u << 16),
793 eTypeClassVector = (1u << 17),
794 // Define the last type class as the MSBit of a 32 bit value
795 eTypeClassOther = (1u << 31),
796 // Define a mask that can be used for any type when finding types
797 eTypeClassAny = (0xffffffffu)};
798 LLDB_MARK_AS_BITMASK_ENUM(TypeClass)
800 enum TemplateArgumentKind {
801 eTemplateArgumentKindNull = 0,
802 eTemplateArgumentKindType,
803 eTemplateArgumentKindDeclaration,
804 eTemplateArgumentKindIntegral,
805 eTemplateArgumentKindTemplate,
806 eTemplateArgumentKindTemplateExpansion,
807 eTemplateArgumentKindExpression,
808 eTemplateArgumentKindPack,
809 eTemplateArgumentKindNullPtr,
812 /// Options that can be set for a formatter to alter its behavior. Not
813 /// all of these are applicable to all formatter types.
814 FLAGS_ENUM(TypeOptions){eTypeOptionNone = (0u),
815 eTypeOptionCascade = (1u << 0),
816 eTypeOptionSkipPointers = (1u << 1),
817 eTypeOptionSkipReferences = (1u << 2),
818 eTypeOptionHideChildren = (1u << 3),
819 eTypeOptionHideValue = (1u << 4),
820 eTypeOptionShowOneLiner = (1u << 5),
821 eTypeOptionHideNames = (1u << 6),
822 eTypeOptionNonCacheable = (1u << 7),
823 eTypeOptionHideEmptyAggregates = (1u << 8),
824 eTypeOptionFrontEndWantsDereference = (1u << 9)};
826 /// This is the return value for frame comparisons. If you are comparing frame
827 /// A to frame B the following cases arise:
829 /// 1) When frame A pushes frame B (or a frame that ends up pushing
830 /// B) A is Older than B.
832 /// 2) When frame A pushed frame B (or if frameA is on the stack
833 /// but B is not) A is Younger than B.
835 /// 3) When frame A and frame B have the same StackID, they are
838 /// 4) When frame A and frame B have the same immediate parent
839 /// frame, but are not equal, the comparison yields SameParent.
841 /// 5) If the two frames are on different threads or processes the
842 /// comparison is Invalid.
844 /// 6) If for some reason we can't figure out what went on, we
846 enum FrameComparison {
847 eFrameCompareInvalid,
848 eFrameCompareUnknown,
850 eFrameCompareSameParent,
851 eFrameCompareYounger,
855 /// File Permissions.
857 /// Designed to mimic the unix file permission bits so they can be used with
858 /// functions that set 'mode_t' to certain values for permissions.
859 FLAGS_ENUM(FilePermissions){
860 eFilePermissionsUserRead = (1u << 8),
861 eFilePermissionsUserWrite = (1u << 7),
862 eFilePermissionsUserExecute = (1u << 6),
863 eFilePermissionsGroupRead = (1u << 5),
864 eFilePermissionsGroupWrite = (1u << 4),
865 eFilePermissionsGroupExecute = (1u << 3),
866 eFilePermissionsWorldRead = (1u << 2),
867 eFilePermissionsWorldWrite = (1u << 1),
868 eFilePermissionsWorldExecute = (1u << 0),
870 eFilePermissionsUserRW = (eFilePermissionsUserRead |
871 eFilePermissionsUserWrite | 0),
872 eFileFilePermissionsUserRX = (eFilePermissionsUserRead | 0 |
873 eFilePermissionsUserExecute),
874 eFilePermissionsUserRWX = (eFilePermissionsUserRead |
875 eFilePermissionsUserWrite |
876 eFilePermissionsUserExecute),
878 eFilePermissionsGroupRW = (eFilePermissionsGroupRead |
879 eFilePermissionsGroupWrite | 0),
880 eFilePermissionsGroupRX = (eFilePermissionsGroupRead | 0 |
881 eFilePermissionsGroupExecute),
882 eFilePermissionsGroupRWX = (eFilePermissionsGroupRead |
883 eFilePermissionsGroupWrite |
884 eFilePermissionsGroupExecute),
886 eFilePermissionsWorldRW = (eFilePermissionsWorldRead |
887 eFilePermissionsWorldWrite | 0),
888 eFilePermissionsWorldRX = (eFilePermissionsWorldRead | 0 |
889 eFilePermissionsWorldExecute),
890 eFilePermissionsWorldRWX = (eFilePermissionsWorldRead |
891 eFilePermissionsWorldWrite |
892 eFilePermissionsWorldExecute),
894 eFilePermissionsEveryoneR = (eFilePermissionsUserRead |
895 eFilePermissionsGroupRead |
896 eFilePermissionsWorldRead),
897 eFilePermissionsEveryoneW = (eFilePermissionsUserWrite |
898 eFilePermissionsGroupWrite |
899 eFilePermissionsWorldWrite),
900 eFilePermissionsEveryoneX = (eFilePermissionsUserExecute |
901 eFilePermissionsGroupExecute |
902 eFilePermissionsWorldExecute),
904 eFilePermissionsEveryoneRW = (eFilePermissionsEveryoneR |
905 eFilePermissionsEveryoneW | 0),
906 eFilePermissionsEveryoneRX = (eFilePermissionsEveryoneR | 0 |
907 eFilePermissionsEveryoneX),
908 eFilePermissionsEveryoneRWX = (eFilePermissionsEveryoneR |
909 eFilePermissionsEveryoneW |
910 eFilePermissionsEveryoneX),
911 eFilePermissionsFileDefault = eFilePermissionsUserRW,
912 eFilePermissionsDirectoryDefault = eFilePermissionsUserRWX,
915 /// Queue work item types.
917 /// The different types of work that can be enqueued on a libdispatch aka Grand
918 /// Central Dispatch (GCD) queue.
920 eQueueItemKindUnknown = 0,
921 eQueueItemKindFunction,
927 /// libdispatch aka Grand Central Dispatch (GCD) queues can be either
928 /// serial (executing on one thread) or concurrent (executing on
929 /// multiple threads).
931 eQueueKindUnknown = 0,
936 /// Expression Evaluation Stages.
938 /// These are the cancellable stages of expression evaluation, passed
939 /// to the expression evaluation callback, so that you can interrupt
940 /// expression evaluation at the various points in its lifecycle.
941 enum ExpressionEvaluationPhase {
942 eExpressionEvaluationParse = 0,
943 eExpressionEvaluationIRGen,
944 eExpressionEvaluationExecution,
945 eExpressionEvaluationComplete
950 /// Indicates what types of events cause the watchpoint to fire. Used by Native
951 /// *Protocol-related classes.
952 FLAGS_ENUM(WatchpointKind){eWatchpointKindWrite = (1u << 0),
953 eWatchpointKindRead = (1u << 1)};
956 eGdbSignalBadAccess = 0x91,
957 eGdbSignalBadInstruction = 0x92,
958 eGdbSignalArithmetic = 0x93,
959 eGdbSignalEmulation = 0x94,
960 eGdbSignalSoftware = 0x95,
961 eGdbSignalBreakpoint = 0x96
964 /// Used with SBHost::GetPath (lldb::PathType) to find files that are
965 /// related to LLDB on the current host machine. Most files are
966 /// relative to LLDB or are in known locations.
968 ePathTypeLLDBShlibDir, ///< The directory where the lldb.so (unix) or LLDB
969 ///< mach-o file in LLDB.framework (MacOSX) exists
970 ePathTypeSupportExecutableDir, ///< Find LLDB support executable directory
971 ///< (debugserver, etc)
972 ePathTypeHeaderDir, ///< Find LLDB header file directory
973 ePathTypePythonDir, ///< Find Python modules (PYTHONPATH) directory
974 ePathTypeLLDBSystemPlugins, ///< System plug-ins directory
975 ePathTypeLLDBUserPlugins, ///< User plug-ins directory
976 ePathTypeLLDBTempSystemDir, ///< The LLDB temp directory for this system that
977 ///< will be cleaned up on exit
978 ePathTypeGlobalLLDBTempSystemDir, ///< The LLDB temp directory for this
979 ///< system, NOT cleaned up on a process
981 ePathTypeClangDir ///< Find path to Clang builtin headers
984 /// Kind of member function.
986 /// Used by the type system.
987 enum MemberFunctionKind {
988 eMemberFunctionKindUnknown = 0, ///< Not sure what the type of this is
989 eMemberFunctionKindConstructor, ///< A function used to create instances
990 eMemberFunctionKindDestructor, ///< A function used to tear down existing
992 eMemberFunctionKindInstanceMethod, ///< A function that applies to a specific
994 eMemberFunctionKindStaticMethod ///< A function that applies to a type rather
995 ///< than any instance
998 /// String matching algorithm used by SBTarget.
999 enum MatchType { eMatchTypeNormal, eMatchTypeRegex, eMatchTypeStartsWith };
1001 /// Bitmask that describes details about a type.
1002 FLAGS_ENUM(TypeFlags){
1003 eTypeHasChildren = (1u << 0), eTypeHasValue = (1u << 1),
1004 eTypeIsArray = (1u << 2), eTypeIsBlock = (1u << 3),
1005 eTypeIsBuiltIn = (1u << 4), eTypeIsClass = (1u << 5),
1006 eTypeIsCPlusPlus = (1u << 6), eTypeIsEnumeration = (1u << 7),
1007 eTypeIsFuncPrototype = (1u << 8), eTypeIsMember = (1u << 9),
1008 eTypeIsObjC = (1u << 10), eTypeIsPointer = (1u << 11),
1009 eTypeIsReference = (1u << 12), eTypeIsStructUnion = (1u << 13),
1010 eTypeIsTemplate = (1u << 14), eTypeIsTypedef = (1u << 15),
1011 eTypeIsVector = (1u << 16), eTypeIsScalar = (1u << 17),
1012 eTypeIsInteger = (1u << 18), eTypeIsFloat = (1u << 19),
1013 eTypeIsComplex = (1u << 20), eTypeIsSigned = (1u << 21),
1014 eTypeInstanceIsPointer = (1u << 22)};
1016 FLAGS_ENUM(CommandFlags){
1017 /// eCommandRequiresTarget
1019 /// Ensures a valid target is contained in m_exe_ctx prior to executing the
1020 /// command. If a target doesn't exist or is invalid, the command will fail
1021 /// and CommandObject::GetInvalidTargetDescription() will be returned as the
1022 /// error. CommandObject subclasses can override the virtual function for
1023 /// GetInvalidTargetDescription() to provide custom strings when needed.
1024 eCommandRequiresTarget = (1u << 0),
1025 /// eCommandRequiresProcess
1027 /// Ensures a valid process is contained in m_exe_ctx prior to executing the
1028 /// command. If a process doesn't exist or is invalid, the command will fail
1029 /// and CommandObject::GetInvalidProcessDescription() will be returned as
1030 /// the error. CommandObject subclasses can override the virtual function
1031 /// for GetInvalidProcessDescription() to provide custom strings when
1033 eCommandRequiresProcess = (1u << 1),
1034 /// eCommandRequiresThread
1036 /// Ensures a valid thread is contained in m_exe_ctx prior to executing the
1037 /// command. If a thread doesn't exist or is invalid, the command will fail
1038 /// and CommandObject::GetInvalidThreadDescription() will be returned as the
1039 /// error. CommandObject subclasses can override the virtual function for
1040 /// GetInvalidThreadDescription() to provide custom strings when needed.
1041 eCommandRequiresThread = (1u << 2),
1042 /// eCommandRequiresFrame
1044 /// Ensures a valid frame is contained in m_exe_ctx prior to executing the
1045 /// command. If a frame doesn't exist or is invalid, the command will fail
1046 /// and CommandObject::GetInvalidFrameDescription() will be returned as the
1047 /// error. CommandObject subclasses can override the virtual function for
1048 /// GetInvalidFrameDescription() to provide custom strings when needed.
1049 eCommandRequiresFrame = (1u << 3),
1050 /// eCommandRequiresRegContext
1052 /// Ensures a valid register context (from the selected frame if there is a
1053 /// frame in m_exe_ctx, or from the selected thread from m_exe_ctx) is
1054 /// available from m_exe_ctx prior to executing the command. If a target
1055 /// doesn't exist or is invalid, the command will fail and
1056 /// CommandObject::GetInvalidRegContextDescription() will be returned as the
1057 /// error. CommandObject subclasses can override the virtual function for
1058 /// GetInvalidRegContextDescription() to provide custom strings when needed.
1059 eCommandRequiresRegContext = (1u << 4),
1060 /// eCommandTryTargetAPILock
1062 /// Attempts to acquire the target lock if a target is selected in the
1063 /// command interpreter. If the command object fails to acquire the API
1064 /// lock, the command will fail with an appropriate error message.
1065 eCommandTryTargetAPILock = (1u << 5),
1066 /// eCommandProcessMustBeLaunched
1068 /// Verifies that there is a launched process in m_exe_ctx, if there isn't,
1069 /// the command will fail with an appropriate error message.
1070 eCommandProcessMustBeLaunched = (1u << 6),
1071 /// eCommandProcessMustBePaused
1073 /// Verifies that there is a paused process in m_exe_ctx, if there isn't,
1074 /// the command will fail with an appropriate error message.
1075 eCommandProcessMustBePaused = (1u << 7)};
1077 /// Whether a summary should cap how much data it returns to users or not.
1078 enum TypeSummaryCapping {
1079 eTypeSummaryCapped = true,
1080 eTypeSummaryUncapped = false
1084 #endif // LLDB_lldb_enumerations_h_