1 //===-- lldb-enumerations.h -------------------------------------*- C++ -*-===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 #ifndef LLDB_lldb_enumerations_h_
11 #define LLDB_lldb_enumerations_h_
13 #include <type_traits>
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)); \
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)); \
33 constexpr Enum operator~(Enum a) { \
34 return static_cast<Enum>( \
35 ~static_cast<std::underlying_type<Enum>::type>(a)); \
37 inline Enum &operator|=(Enum &a, Enum b) { \
41 inline Enum &operator&=(Enum &a, Enum b) { \
46 #define LLDB_MARK_AS_BITMASK_ENUM(Enum)
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.
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
67 #define FLAGS_ENUM(Name) enum Name
68 #define FLAGS_ANONYMOUS_ENUM() enum
73 //----------------------------------------------------------------------
74 // Process and Thread States
75 //----------------------------------------------------------------------
78 eStateUnloaded, ///< Process is object is valid, but not currently loaded
79 eStateConnected, ///< Process is connected to remote debug services, but not
80 ///launched or attached to anything yet
81 eStateAttaching, ///< Process is currently trying to attach
82 eStateLaunching, ///< Process is in the process of launching
83 // The state changes eStateAttaching and eStateLaunching are both sent while the
84 // private state thread is either not yet started or paused. For that reason, they
85 // should only be signaled as public state changes, and not private state changes.
86 eStateStopped, ///< Process or thread is stopped and can be examined.
87 eStateRunning, ///< Process or thread is running and can't be examined.
88 eStateStepping, ///< Process or thread is in the process of stepping and can
90 eStateCrashed, ///< Process or thread has crashed and can be examined.
91 eStateDetached, ///< Process has been detached and can't be examined.
92 eStateExited, ///< Process has exited and can't be examined.
93 eStateSuspended, ///< Process or thread is in a suspended state as far
94 ///< as the debugger is concerned while other processes
95 ///< or threads get the chance to run.
96 kLastStateType = eStateSuspended
99 //----------------------------------------------------------------------
101 //----------------------------------------------------------------------
102 FLAGS_ENUM(LaunchFlags){
103 eLaunchFlagNone = 0u,
104 eLaunchFlagExec = (1u << 0), ///< Exec when launching and turn the calling
105 ///process into a new process
106 eLaunchFlagDebug = (1u << 1), ///< Stop as soon as the process launches to
107 ///allow the process to be debugged
108 eLaunchFlagStopAtEntry = (1u << 2), ///< Stop at the program entry point
109 ///instead of auto-continuing when
110 ///launching or attaching at entry point
111 eLaunchFlagDisableASLR =
112 (1u << 3), ///< Disable Address Space Layout Randomization
113 eLaunchFlagDisableSTDIO =
114 (1u << 4), ///< Disable stdio for inferior process (e.g. for a GUI app)
115 eLaunchFlagLaunchInTTY =
116 (1u << 5), ///< Launch the process in a new TTY if supported by the host
117 eLaunchFlagLaunchInShell =
118 (1u << 6), ///< Launch the process inside a shell to get shell expansion
119 eLaunchFlagLaunchInSeparateProcessGroup =
120 (1u << 7), ///< Launch the process in a separate process group
121 eLaunchFlagDontSetExitStatus = (1u << 8), ///< If you are going to hand the
122 ///process off (e.g. to
124 ///< set this flag so lldb & the handee don't race to set its exit status.
125 eLaunchFlagDetachOnError = (1u << 9), ///< If set, then the client stub
126 ///should detach rather than killing
128 ///< if it loses connection with lldb.
129 eLaunchFlagShellExpandArguments =
130 (1u << 10), ///< Perform shell-style argument expansion
131 eLaunchFlagCloseTTYOnExit = (1u << 11), ///< Close the open TTY on exit
134 //----------------------------------------------------------------------
136 //----------------------------------------------------------------------
137 enum RunMode { eOnlyThisThread, eAllThreads, eOnlyDuringStepping };
139 //----------------------------------------------------------------------
140 // Byte ordering definitions
141 //----------------------------------------------------------------------
143 eByteOrderInvalid = 0,
149 //----------------------------------------------------------------------
150 // Register encoding definitions
151 //----------------------------------------------------------------------
153 eEncodingInvalid = 0,
154 eEncodingUint, // unsigned integer
155 eEncodingSint, // signed integer
156 eEncodingIEEE754, // float
157 eEncodingVector // vector registers
160 //----------------------------------------------------------------------
161 // Display format definitions
162 //----------------------------------------------------------------------
169 eFormatBytesWithASCII,
171 eFormatCharPrintable, // Only printable characters, space if not printable
172 eFormatComplex, // Floating point complex type
173 eFormatComplexFloat = eFormatComplex,
174 eFormatCString, // NULL terminated C strings
181 eFormatOSType, // OS character codes encoded into an integer 'PICT' 'text'
188 eFormatVectorOfSInt8,
189 eFormatVectorOfUInt8,
190 eFormatVectorOfSInt16,
191 eFormatVectorOfUInt16,
192 eFormatVectorOfSInt32,
193 eFormatVectorOfUInt32,
194 eFormatVectorOfSInt64,
195 eFormatVectorOfUInt64,
196 eFormatVectorOfFloat16,
197 eFormatVectorOfFloat32,
198 eFormatVectorOfFloat64,
199 eFormatVectorOfUInt128,
200 eFormatComplexInteger, // Integer complex type
201 eFormatCharArray, // Print characters with no single quotes, used for
202 // character arrays that can contain non printable
204 eFormatAddressInfo, // Describe what an address points to (func + offset with
205 // file/line, symbol + offset, data, etc)
206 eFormatHexFloat, // ISO C99 hex float string
207 eFormatInstruction, // Disassemble an opcode
208 eFormatVoid, // Do not print this
212 //----------------------------------------------------------------------
213 // Description levels for "void GetDescription(Stream *, DescriptionLevel)"
215 //----------------------------------------------------------------------
216 enum DescriptionLevel {
217 eDescriptionLevelBrief = 0,
218 eDescriptionLevelFull,
219 eDescriptionLevelVerbose,
220 eDescriptionLevelInitial,
221 kNumDescriptionLevels
224 //----------------------------------------------------------------------
225 // Script interpreter types
226 //----------------------------------------------------------------------
227 enum ScriptLanguage {
229 eScriptLanguagePython,
230 eScriptLanguageDefault = eScriptLanguagePython,
231 eScriptLanguageUnknown
234 //----------------------------------------------------------------------
235 // Register numbering types
236 // See RegisterContext::ConvertRegisterKindToRegisterNumber to convert any of
237 // these to the lldb internal register numbering scheme (eRegisterKindLLDB).
238 //----------------------------------------------------------------------
240 eRegisterKindEHFrame = 0, // the register numbers seen in eh_frame
241 eRegisterKindDWARF, // the register numbers seen DWARF
242 eRegisterKindGeneric, // insn ptr reg, stack ptr reg, etc not specific to any
244 eRegisterKindProcessPlugin, // num used by the process plugin - e.g. by the
245 // remote gdb-protocol stub program
246 eRegisterKindLLDB, // lldb's internal register numbers
250 //----------------------------------------------------------------------
251 // Thread stop reasons
252 //----------------------------------------------------------------------
254 eStopReasonInvalid = 0,
257 eStopReasonBreakpoint,
258 eStopReasonWatchpoint,
260 eStopReasonException,
261 eStopReasonExec, // Program was re-exec'ed
262 eStopReasonPlanComplete,
263 eStopReasonThreadExiting,
264 eStopReasonInstrumentation
267 //----------------------------------------------------------------------
268 // Command Return Status Types
269 //----------------------------------------------------------------------
271 eReturnStatusInvalid,
272 eReturnStatusSuccessFinishNoResult,
273 eReturnStatusSuccessFinishResult,
274 eReturnStatusSuccessContinuingNoResult,
275 eReturnStatusSuccessContinuingResult,
276 eReturnStatusStarted,
281 //----------------------------------------------------------------------
282 // The results of expression evaluation:
283 //----------------------------------------------------------------------
284 enum ExpressionResults {
285 eExpressionCompleted = 0,
286 eExpressionSetupError,
287 eExpressionParseError,
288 eExpressionDiscarded,
289 eExpressionInterrupted,
290 eExpressionHitBreakpoint,
292 eExpressionResultUnavailable,
293 eExpressionStoppedForDebug
297 eSearchDepthInvalid = 0,
300 eSearchDepthCompUnit,
301 eSearchDepthFunction,
304 kLastSearchDepthKind = eSearchDepthAddress
307 //----------------------------------------------------------------------
308 // Connection Status Types
309 //----------------------------------------------------------------------
310 enum ConnectionStatus {
311 eConnectionStatusSuccess, // Success
312 eConnectionStatusEndOfFile, // End-of-file encountered
313 eConnectionStatusError, // Check GetError() for details
314 eConnectionStatusTimedOut, // Request timed out
315 eConnectionStatusNoConnection, // No connection
316 eConnectionStatusLostConnection, // Lost connection while connected to a valid
318 eConnectionStatusInterrupted // Interrupted read
323 eErrorTypeGeneric, ///< Generic errors that can be any value.
324 eErrorTypeMachKernel, ///< Mach kernel error codes.
325 eErrorTypePOSIX, ///< POSIX error codes.
326 eErrorTypeExpression, ///< These are from the ExpressionResults enum.
327 eErrorTypeWin32 ///< Standard Win32 error codes.
331 eValueTypeInvalid = 0,
332 eValueTypeVariableGlobal = 1, // globals variable
333 eValueTypeVariableStatic = 2, // static variable
334 eValueTypeVariableArgument = 3, // function argument variables
335 eValueTypeVariableLocal = 4, // function local variables
336 eValueTypeRegister = 5, // stack frame register value
337 eValueTypeRegisterSet = 6, // A collection of stack frame register values
338 eValueTypeConstResult = 7, // constant result variables
339 eValueTypeVariableThreadLocal = 8 // thread local storage variable
342 //----------------------------------------------------------------------
343 // Token size/granularities for Input Readers
344 //----------------------------------------------------------------------
346 enum InputReaderGranularity {
347 eInputReaderGranularityInvalid = 0,
348 eInputReaderGranularityByte,
349 eInputReaderGranularityWord,
350 eInputReaderGranularityLine,
351 eInputReaderGranularityAll
354 //------------------------------------------------------------------
355 /// These mask bits allow a common interface for queries that can
356 /// limit the amount of information that gets parsed to only the
357 /// information that is requested. These bits also can indicate what
358 /// actually did get resolved during query function calls.
360 /// Each definition corresponds to a one of the member variables
361 /// in this class, and requests that that item be resolved, or
362 /// indicates that the member did get resolved.
363 //------------------------------------------------------------------
364 FLAGS_ENUM(SymbolContextItem){
365 eSymbolContextTarget = (1u << 0), ///< Set when \a target is requested from
366 /// a query, or was located in query
368 eSymbolContextModule = (1u << 1), ///< Set when \a module is requested from
369 /// a query, or was located in query
371 eSymbolContextCompUnit = (1u << 2), ///< Set when \a comp_unit is requested
372 /// from a query, or was located in
374 eSymbolContextFunction = (1u << 3), ///< Set when \a function is requested
375 /// from a query, or was located in
377 eSymbolContextBlock = (1u << 4), ///< Set when the deepest \a block is
378 /// requested from a query, or was located
380 eSymbolContextLineEntry = (1u << 5), ///< Set when \a line_entry is
381 /// requested from a query, or was
382 /// located in query results
383 eSymbolContextSymbol = (1u << 6), ///< Set when \a symbol is requested from
384 /// a query, or was located in query
386 eSymbolContextEverything = ((eSymbolContextSymbol << 1) -
387 1u), ///< Indicates to try and lookup everything
388 /// up during a routine symbol context
390 eSymbolContextVariable = (1u << 7), ///< Set when \a global or static
391 /// variable is requested from a query,
392 /// or was located in query results.
393 ///< eSymbolContextVariable is potentially expensive to lookup so it isn't
395 ///< eSymbolContextEverything which stops it from being used during frame PC
397 ///< many other potential address to symbol context lookups.
399 LLDB_MARK_AS_BITMASK_ENUM(SymbolContextItem)
401 FLAGS_ENUM(Permissions){ePermissionsWritable = (1u << 0),
402 ePermissionsReadable = (1u << 1),
403 ePermissionsExecutable = (1u << 2)};
404 LLDB_MARK_AS_BITMASK_ENUM(Permissions)
406 enum InputReaderAction {
407 eInputReaderActivate, // reader is newly pushed onto the reader stack
408 eInputReaderAsynchronousOutputWritten, // an async output event occurred; the
409 // reader may want to do something
410 eInputReaderReactivate, // reader is on top of the stack again after another
411 // reader was popped off
412 eInputReaderDeactivate, // another reader was pushed on the stack
413 eInputReaderGotToken, // reader got one of its tokens (granularity)
414 eInputReaderInterrupt, // reader received an interrupt signal (probably from a
416 eInputReaderEndOfFile, // reader received an EOF char (probably from a
418 eInputReaderDone // reader was just popped off the stack and is done
421 FLAGS_ENUM(BreakpointEventType){
422 eBreakpointEventTypeInvalidType = (1u << 0),
423 eBreakpointEventTypeAdded = (1u << 1),
424 eBreakpointEventTypeRemoved = (1u << 2),
425 eBreakpointEventTypeLocationsAdded = (1u << 3), // Locations added doesn't
427 // breakpoint is created
428 eBreakpointEventTypeLocationsRemoved = (1u << 4),
429 eBreakpointEventTypeLocationsResolved = (1u << 5),
430 eBreakpointEventTypeEnabled = (1u << 6),
431 eBreakpointEventTypeDisabled = (1u << 7),
432 eBreakpointEventTypeCommandChanged = (1u << 8),
433 eBreakpointEventTypeConditionChanged = (1u << 9),
434 eBreakpointEventTypeIgnoreChanged = (1u << 10),
435 eBreakpointEventTypeThreadChanged = (1u << 11),
436 eBreakpointEventTypeAutoContinueChanged = (1u << 12)};
438 FLAGS_ENUM(WatchpointEventType){
439 eWatchpointEventTypeInvalidType = (1u << 0),
440 eWatchpointEventTypeAdded = (1u << 1),
441 eWatchpointEventTypeRemoved = (1u << 2),
442 eWatchpointEventTypeEnabled = (1u << 6),
443 eWatchpointEventTypeDisabled = (1u << 7),
444 eWatchpointEventTypeCommandChanged = (1u << 8),
445 eWatchpointEventTypeConditionChanged = (1u << 9),
446 eWatchpointEventTypeIgnoreChanged = (1u << 10),
447 eWatchpointEventTypeThreadChanged = (1u << 11),
448 eWatchpointEventTypeTypeChanged = (1u << 12)};
450 //----------------------------------------------------------------------
451 /// Programming language type.
453 /// These enumerations use the same language enumerations as the DWARF
454 /// specification for ease of use and consistency.
455 /// The enum -> string code is in Language.cpp, don't change this
456 /// table without updating that code as well.
457 //----------------------------------------------------------------------
459 eLanguageTypeUnknown = 0x0000, ///< Unknown or invalid language value.
460 eLanguageTypeC89 = 0x0001, ///< ISO C:1989.
461 eLanguageTypeC = 0x0002, ///< Non-standardized C, such as K&R.
462 eLanguageTypeAda83 = 0x0003, ///< ISO Ada:1983.
463 eLanguageTypeC_plus_plus = 0x0004, ///< ISO C++:1998.
464 eLanguageTypeCobol74 = 0x0005, ///< ISO Cobol:1974.
465 eLanguageTypeCobol85 = 0x0006, ///< ISO Cobol:1985.
466 eLanguageTypeFortran77 = 0x0007, ///< ISO Fortran 77.
467 eLanguageTypeFortran90 = 0x0008, ///< ISO Fortran 90.
468 eLanguageTypePascal83 = 0x0009, ///< ISO Pascal:1983.
469 eLanguageTypeModula2 = 0x000a, ///< ISO Modula-2:1996.
470 eLanguageTypeJava = 0x000b, ///< Java.
471 eLanguageTypeC99 = 0x000c, ///< ISO C:1999.
472 eLanguageTypeAda95 = 0x000d, ///< ISO Ada:1995.
473 eLanguageTypeFortran95 = 0x000e, ///< ISO Fortran 95.
474 eLanguageTypePLI = 0x000f, ///< ANSI PL/I:1976.
475 eLanguageTypeObjC = 0x0010, ///< Objective-C.
476 eLanguageTypeObjC_plus_plus = 0x0011, ///< Objective-C++.
477 eLanguageTypeUPC = 0x0012, ///< Unified Parallel C.
478 eLanguageTypeD = 0x0013, ///< D.
479 eLanguageTypePython = 0x0014, ///< Python.
480 // NOTE: The below are DWARF5 constants, subject to change upon
481 // completion of the DWARF5 specification
482 eLanguageTypeOpenCL = 0x0015, ///< OpenCL.
483 eLanguageTypeGo = 0x0016, ///< Go.
484 eLanguageTypeModula3 = 0x0017, ///< Modula 3.
485 eLanguageTypeHaskell = 0x0018, ///< Haskell.
486 eLanguageTypeC_plus_plus_03 = 0x0019, ///< ISO C++:2003.
487 eLanguageTypeC_plus_plus_11 = 0x001a, ///< ISO C++:2011.
488 eLanguageTypeOCaml = 0x001b, ///< OCaml.
489 eLanguageTypeRust = 0x001c, ///< Rust.
490 eLanguageTypeC11 = 0x001d, ///< ISO C:2011.
491 eLanguageTypeSwift = 0x001e, ///< Swift.
492 eLanguageTypeJulia = 0x001f, ///< Julia.
493 eLanguageTypeDylan = 0x0020, ///< Dylan.
494 eLanguageTypeC_plus_plus_14 = 0x0021, ///< ISO C++:2014.
495 eLanguageTypeFortran03 = 0x0022, ///< ISO Fortran 2003.
496 eLanguageTypeFortran08 = 0x0023, ///< ISO Fortran 2008.
498 // Note: Language::GetNameForLanguageType
499 // assumes these can be used as indexes into array language_names, and
500 // Language::SetLanguageFromCString and Language::AsCString assume these can
501 // be used as indexes into array g_languages.
502 eLanguageTypeMipsAssembler = 0x0024, ///< Mips_Assembler.
503 eLanguageTypeExtRenderScript = 0x0025, ///< RenderScript.
507 enum InstrumentationRuntimeType {
508 eInstrumentationRuntimeTypeAddressSanitizer = 0x0000,
509 eInstrumentationRuntimeTypeThreadSanitizer = 0x0001,
510 eInstrumentationRuntimeTypeUndefinedBehaviorSanitizer = 0x0002,
511 eInstrumentationRuntimeTypeMainThreadChecker = 0x0003,
512 eInstrumentationRuntimeTypeSwiftRuntimeReporting = 0x0004,
513 eNumInstrumentationRuntimeTypes
516 enum DynamicValueType {
517 eNoDynamicValues = 0,
518 eDynamicCanRunTarget = 1,
519 eDynamicDontRunTarget = 2
522 enum StopShowColumn {
523 eStopShowColumnAnsiOrCaret = 0,
524 eStopShowColumnAnsi = 1,
525 eStopShowColumnCaret = 2,
526 eStopShowColumnNone = 3
537 enum CommandArgumentType {
539 eArgTypeAddressOrExpression,
541 eArgTypeAliasOptions,
542 eArgTypeArchitecture,
544 eArgTypeBreakpointID,
545 eArgTypeBreakpointIDRange,
546 eArgTypeBreakpointName,
551 eArgTypeDescriptionVerbosity,
552 eArgTypeDirectoryName,
553 eArgTypeDisassemblyFlavor,
556 eArgTypeExpressionPath,
562 eArgTypeFunctionName,
563 eArgTypeFunctionOrSymbol,
573 eArgTypeNewPathPrefix,
575 eArgTypeNumberPerLine,
577 eArgTypeOldPathPrefix,
580 eArgTypePermissionsNumber,
581 eArgTypePermissionsString,
586 eArgTypePythonFunction,
587 eArgTypePythonScript,
589 eArgTypeRegisterName,
590 eArgTypeRegularExpression,
593 eArgTypeScriptedCommandSynchronicity,
597 eArgTypeSettingIndex,
599 eArgTypeSettingPrefix,
600 eArgTypeSettingVariableName,
604 eArgTypeStartAddress,
605 eArgTypeSummaryString,
611 eArgTypeUnsignedInteger,
618 eArgTypeWatchpointID,
619 eArgTypeWatchpointIDRange,
623 eArgTypeLastArg // Always keep this entry as the last entry in this
627 //----------------------------------------------------------------------
629 //----------------------------------------------------------------------
632 eSymbolTypeInvalid = 0,
637 eSymbolTypeTrampoline,
639 eSymbolTypeException,
640 eSymbolTypeSourceFile,
641 eSymbolTypeHeaderFile,
642 eSymbolTypeObjectFile,
643 eSymbolTypeCommonBlock,
648 eSymbolTypeVariableType,
649 eSymbolTypeLineEntry,
650 eSymbolTypeLineHeader,
651 eSymbolTypeScopeBegin,
653 eSymbolTypeAdditional, // When symbols take more than one entry, the extra
654 // entries get this type
656 eSymbolTypeInstrumentation,
657 eSymbolTypeUndefined,
658 eSymbolTypeObjCClass,
659 eSymbolTypeObjCMetaClass,
661 eSymbolTypeReExported
667 eSectionTypeContainer, // The section contains child sections
669 eSectionTypeDataCString, // Inlined C string data
670 eSectionTypeDataCStringPointers, // Pointers to C string data
671 eSectionTypeDataSymbolAddress, // Address of a symbol in the symbol table
675 eSectionTypeDataPointers,
677 eSectionTypeZeroFill,
678 eSectionTypeDataObjCMessageRefs, // Pointer to function pointer + selector
679 eSectionTypeDataObjCCFStrings, // Objective-C const CFString/NSString objects
680 eSectionTypeDWARFDebugAbbrev,
681 eSectionTypeDWARFDebugAddr,
682 eSectionTypeDWARFDebugAranges,
683 eSectionTypeDWARFDebugCuIndex,
684 eSectionTypeDWARFDebugFrame,
685 eSectionTypeDWARFDebugInfo,
686 eSectionTypeDWARFDebugLine,
687 eSectionTypeDWARFDebugLoc,
688 eSectionTypeDWARFDebugMacInfo,
689 eSectionTypeDWARFDebugMacro,
690 eSectionTypeDWARFDebugPubNames,
691 eSectionTypeDWARFDebugPubTypes,
692 eSectionTypeDWARFDebugRanges,
693 eSectionTypeDWARFDebugStr,
694 eSectionTypeDWARFDebugStrOffsets,
695 eSectionTypeDWARFAppleNames,
696 eSectionTypeDWARFAppleTypes,
697 eSectionTypeDWARFAppleNamespaces,
698 eSectionTypeDWARFAppleObjC,
699 eSectionTypeELFSymbolTable, // Elf SHT_SYMTAB section
700 eSectionTypeELFDynamicSymbols, // Elf SHT_DYNSYM section
701 eSectionTypeELFRelocationEntries, // Elf SHT_REL or SHT_REL section
702 eSectionTypeELFDynamicLinkInfo, // Elf SHT_DYNAMIC section
704 eSectionTypeARMexidx,
705 eSectionTypeARMextab,
706 eSectionTypeCompactUnwind, // compact unwind section in Mach-O,
707 // __TEXT,__unwind_info
708 eSectionTypeGoSymtab,
709 eSectionTypeAbsoluteAddress, // Dummy section for symbols with absolute
711 eSectionTypeDWARFGNUDebugAltLink,
712 eSectionTypeDWARFDebugTypes, // DWARF .debug_types section
713 eSectionTypeDWARFDebugNames, // DWARF v5 .debug_names
715 eSectionTypeDWARFDebugLineStr, // DWARF v5 .debug_line_str
716 eSectionTypeDWARFDebugRngLists, // DWARF v5 .debug_rnglists
717 eSectionTypeDWARFDebugLocLists, // DWARF v5 .debug_loclists
718 eSectionTypeDWARFDebugAbbrevDwo,
719 eSectionTypeDWARFDebugInfoDwo,
720 eSectionTypeDWARFDebugStrDwo,
721 eSectionTypeDWARFDebugStrOffsetsDwo,
724 FLAGS_ENUM(EmulateInstructionOptions){
725 eEmulateInstructionOptionNone = (0u),
726 eEmulateInstructionOptionAutoAdvancePC = (1u << 0),
727 eEmulateInstructionOptionIgnoreConditions = (1u << 1)};
729 FLAGS_ENUM(FunctionNameType){
730 eFunctionNameTypeNone = 0u,
731 eFunctionNameTypeAuto =
732 (1u << 1), // Automatically figure out which FunctionNameType
733 // bits to set based on the function name.
734 eFunctionNameTypeFull = (1u << 2), // The function name.
735 // For C this is the same as just the name of the function For C++ this is
736 // the mangled or demangled version of the mangled name. For ObjC this is
737 // the full function signature with the + or - and the square brackets and
738 // the class and selector
739 eFunctionNameTypeBase = (1u << 3), // The function name only, no namespaces
740 // or arguments and no class
741 // methods or selectors will be searched.
742 eFunctionNameTypeMethod = (1u << 4), // Find function by method name (C++)
743 // with no namespace or arguments
744 eFunctionNameTypeSelector =
745 (1u << 5), // Find function by selector name (ObjC) names
746 eFunctionNameTypeAny =
747 eFunctionNameTypeAuto // DEPRECATED: use eFunctionNameTypeAuto
749 LLDB_MARK_AS_BITMASK_ENUM(FunctionNameType)
751 //----------------------------------------------------------------------
752 // Basic types enumeration for the public API SBType::GetBasicType()
753 //----------------------------------------------------------------------
755 eBasicTypeInvalid = 0,
758 eBasicTypeSignedChar,
759 eBasicTypeUnsignedChar,
761 eBasicTypeSignedWChar,
762 eBasicTypeUnsignedWChar,
766 eBasicTypeUnsignedShort,
768 eBasicTypeUnsignedInt,
770 eBasicTypeUnsignedLong,
772 eBasicTypeUnsignedLongLong,
774 eBasicTypeUnsignedInt128,
779 eBasicTypeLongDouble,
780 eBasicTypeFloatComplex,
781 eBasicTypeDoubleComplex,
782 eBasicTypeLongDoubleComplex,
793 // Hardware Trace generated by the processor.
794 eTraceTypeProcessorTrace
797 enum StructuredDataType {
798 eStructuredDataTypeInvalid = -1,
799 eStructuredDataTypeNull = 0,
800 eStructuredDataTypeGeneric,
801 eStructuredDataTypeArray,
802 eStructuredDataTypeInteger,
803 eStructuredDataTypeFloat,
804 eStructuredDataTypeBoolean,
805 eStructuredDataTypeString,
806 eStructuredDataTypeDictionary
809 FLAGS_ENUM(TypeClass){
810 eTypeClassInvalid = (0u), eTypeClassArray = (1u << 0),
811 eTypeClassBlockPointer = (1u << 1), eTypeClassBuiltin = (1u << 2),
812 eTypeClassClass = (1u << 3), eTypeClassComplexFloat = (1u << 4),
813 eTypeClassComplexInteger = (1u << 5), eTypeClassEnumeration = (1u << 6),
814 eTypeClassFunction = (1u << 7), eTypeClassMemberPointer = (1u << 8),
815 eTypeClassObjCObject = (1u << 9), eTypeClassObjCInterface = (1u << 10),
816 eTypeClassObjCObjectPointer = (1u << 11), eTypeClassPointer = (1u << 12),
817 eTypeClassReference = (1u << 13), eTypeClassStruct = (1u << 14),
818 eTypeClassTypedef = (1u << 15), eTypeClassUnion = (1u << 16),
819 eTypeClassVector = (1u << 17),
820 // Define the last type class as the MSBit of a 32 bit value
821 eTypeClassOther = (1u << 31),
822 // Define a mask that can be used for any type when finding types
823 eTypeClassAny = (0xffffffffu)};
824 LLDB_MARK_AS_BITMASK_ENUM(TypeClass)
826 enum TemplateArgumentKind {
827 eTemplateArgumentKindNull = 0,
828 eTemplateArgumentKindType,
829 eTemplateArgumentKindDeclaration,
830 eTemplateArgumentKindIntegral,
831 eTemplateArgumentKindTemplate,
832 eTemplateArgumentKindTemplateExpansion,
833 eTemplateArgumentKindExpression,
834 eTemplateArgumentKindPack,
835 eTemplateArgumentKindNullPtr,
838 //----------------------------------------------------------------------
839 // Options that can be set for a formatter to alter its behavior Not all of
840 // these are applicable to all formatter types
841 //----------------------------------------------------------------------
842 FLAGS_ENUM(TypeOptions){eTypeOptionNone = (0u),
843 eTypeOptionCascade = (1u << 0),
844 eTypeOptionSkipPointers = (1u << 1),
845 eTypeOptionSkipReferences = (1u << 2),
846 eTypeOptionHideChildren = (1u << 3),
847 eTypeOptionHideValue = (1u << 4),
848 eTypeOptionShowOneLiner = (1u << 5),
849 eTypeOptionHideNames = (1u << 6),
850 eTypeOptionNonCacheable = (1u << 7),
851 eTypeOptionHideEmptyAggregates = (1u << 8),
852 eTypeOptionFrontEndWantsDereference = (1u << 9)
855 //----------------------------------------------------------------------
856 // This is the return value for frame comparisons. If you are comparing frame
857 // A to frame B the following cases arise: 1) When frame A pushes frame B (or a
858 // frame that ends up pushing B) A is Older than B. 2) When frame A pushed
859 // frame B (or if frame A is on the stack but B is not) A is Younger than B 3)
860 // When frame A and frame B have the same StackID, they are Equal. 4) When
861 // frame A and frame B have the same immediate parent frame, but are not equal,
862 // the comparison yields
864 // 5) If the two frames are on different threads or processes the comparison is
865 // Invalid 6) If for some reason we can't figure out what went on, we return
867 //----------------------------------------------------------------------
868 enum FrameComparison {
869 eFrameCompareInvalid,
870 eFrameCompareUnknown,
872 eFrameCompareSameParent,
873 eFrameCompareYounger,
877 //----------------------------------------------------------------------
880 // Designed to mimic the unix file permission bits so they can be used with
881 // functions that set 'mode_t' to certain values for permissions.
882 //----------------------------------------------------------------------
883 FLAGS_ENUM(FilePermissions){
884 eFilePermissionsUserRead = (1u << 8), eFilePermissionsUserWrite = (1u << 7),
885 eFilePermissionsUserExecute = (1u << 6),
886 eFilePermissionsGroupRead = (1u << 5),
887 eFilePermissionsGroupWrite = (1u << 4),
888 eFilePermissionsGroupExecute = (1u << 3),
889 eFilePermissionsWorldRead = (1u << 2),
890 eFilePermissionsWorldWrite = (1u << 1),
891 eFilePermissionsWorldExecute = (1u << 0),
893 eFilePermissionsUserRW = (eFilePermissionsUserRead |
894 eFilePermissionsUserWrite | 0),
895 eFileFilePermissionsUserRX = (eFilePermissionsUserRead | 0 |
896 eFilePermissionsUserExecute),
897 eFilePermissionsUserRWX = (eFilePermissionsUserRead |
898 eFilePermissionsUserWrite |
899 eFilePermissionsUserExecute),
901 eFilePermissionsGroupRW = (eFilePermissionsGroupRead |
902 eFilePermissionsGroupWrite | 0),
903 eFilePermissionsGroupRX = (eFilePermissionsGroupRead | 0 |
904 eFilePermissionsGroupExecute),
905 eFilePermissionsGroupRWX = (eFilePermissionsGroupRead |
906 eFilePermissionsGroupWrite |
907 eFilePermissionsGroupExecute),
909 eFilePermissionsWorldRW = (eFilePermissionsWorldRead |
910 eFilePermissionsWorldWrite | 0),
911 eFilePermissionsWorldRX = (eFilePermissionsWorldRead | 0 |
912 eFilePermissionsWorldExecute),
913 eFilePermissionsWorldRWX = (eFilePermissionsWorldRead |
914 eFilePermissionsWorldWrite |
915 eFilePermissionsWorldExecute),
917 eFilePermissionsEveryoneR = (eFilePermissionsUserRead |
918 eFilePermissionsGroupRead |
919 eFilePermissionsWorldRead),
920 eFilePermissionsEveryoneW = (eFilePermissionsUserWrite |
921 eFilePermissionsGroupWrite |
922 eFilePermissionsWorldWrite),
923 eFilePermissionsEveryoneX = (eFilePermissionsUserExecute |
924 eFilePermissionsGroupExecute |
925 eFilePermissionsWorldExecute),
927 eFilePermissionsEveryoneRW = (eFilePermissionsEveryoneR |
928 eFilePermissionsEveryoneW | 0),
929 eFilePermissionsEveryoneRX = (eFilePermissionsEveryoneR | 0 |
930 eFilePermissionsEveryoneX),
931 eFilePermissionsEveryoneRWX = (eFilePermissionsEveryoneR |
932 eFilePermissionsEveryoneW |
933 eFilePermissionsEveryoneX),
934 eFilePermissionsFileDefault = eFilePermissionsUserRW,
935 eFilePermissionsDirectoryDefault = eFilePermissionsUserRWX,
938 //----------------------------------------------------------------------
939 // Queue work item types
941 // The different types of work that can be enqueued on a libdispatch aka Grand
942 // Central Dispatch (GCD) queue.
943 //----------------------------------------------------------------------
945 eQueueItemKindUnknown = 0,
946 eQueueItemKindFunction,
950 //----------------------------------------------------------------------
952 // libdispatch aka Grand Central Dispatch (GCD) queues can be either serial
953 // (executing on one thread) or concurrent (executing on multiple threads).
954 //----------------------------------------------------------------------
956 eQueueKindUnknown = 0,
961 //----------------------------------------------------------------------
962 // Expression Evaluation Stages
963 // These are the cancellable stages of expression evaluation, passed to the
964 // expression evaluation callback, so that you can interrupt expression
965 // evaluation at the various points in its lifecycle.
966 //----------------------------------------------------------------------
967 enum ExpressionEvaluationPhase {
968 eExpressionEvaluationParse = 0,
969 eExpressionEvaluationIRGen,
970 eExpressionEvaluationExecution,
971 eExpressionEvaluationComplete
974 //----------------------------------------------------------------------
976 // Indicates what types of events cause the watchpoint to fire. Used by Native
977 // *Protocol-related classes.
978 //----------------------------------------------------------------------
979 FLAGS_ENUM(WatchpointKind){eWatchpointKindWrite = (1u << 0),
980 eWatchpointKindRead = (1u << 1)};
983 eGdbSignalBadAccess = 0x91,
984 eGdbSignalBadInstruction = 0x92,
985 eGdbSignalArithmetic = 0x93,
986 eGdbSignalEmulation = 0x94,
987 eGdbSignalSoftware = 0x95,
988 eGdbSignalBreakpoint = 0x96
991 //----------------------------------------------------------------------
992 // Used with SBHost::GetPath (lldb::PathType) to find files that are related to
993 // LLDB on the current host machine. Most files are relative to LLDB or are in
995 //----------------------------------------------------------------------
997 ePathTypeLLDBShlibDir, // The directory where the lldb.so (unix) or LLDB
998 // mach-o file in LLDB.framework (MacOSX) exists
999 ePathTypeSupportExecutableDir, // Find LLDB support executable directory
1000 // (debugserver, etc)
1001 ePathTypeHeaderDir, // Find LLDB header file directory
1002 ePathTypePythonDir, // Find Python modules (PYTHONPATH) directory
1003 ePathTypeLLDBSystemPlugins, // System plug-ins directory
1004 ePathTypeLLDBUserPlugins, // User plug-ins directory
1005 ePathTypeLLDBTempSystemDir, // The LLDB temp directory for this system that
1006 // will be cleaned up on exit
1007 ePathTypeGlobalLLDBTempSystemDir, // The LLDB temp directory for this system,
1008 // NOT cleaned up on a process exit.
1009 ePathTypeClangDir // Find path to Clang builtin headers
1012 //----------------------------------------------------------------------
1013 // Kind of member function
1014 // Used by the type system
1015 //----------------------------------------------------------------------
1016 enum MemberFunctionKind {
1017 eMemberFunctionKindUnknown = 0, // Not sure what the type of this is
1018 eMemberFunctionKindConstructor, // A function used to create instances
1019 eMemberFunctionKindDestructor, // A function used to tear down existing
1021 eMemberFunctionKindInstanceMethod, // A function that applies to a specific
1023 eMemberFunctionKindStaticMethod // A function that applies to a type rather
1024 // than any instance
1027 //----------------------------------------------------------------------
1028 // String matching algorithm used by SBTarget
1029 //----------------------------------------------------------------------
1030 enum MatchType { eMatchTypeNormal, eMatchTypeRegex, eMatchTypeStartsWith };
1032 //----------------------------------------------------------------------
1033 // Bitmask that describes details about a type
1034 //----------------------------------------------------------------------
1035 FLAGS_ENUM(TypeFlags){
1036 eTypeHasChildren = (1u << 0), eTypeHasValue = (1u << 1),
1037 eTypeIsArray = (1u << 2), eTypeIsBlock = (1u << 3),
1038 eTypeIsBuiltIn = (1u << 4), eTypeIsClass = (1u << 5),
1039 eTypeIsCPlusPlus = (1u << 6), eTypeIsEnumeration = (1u << 7),
1040 eTypeIsFuncPrototype = (1u << 8), eTypeIsMember = (1u << 9),
1041 eTypeIsObjC = (1u << 10), eTypeIsPointer = (1u << 11),
1042 eTypeIsReference = (1u << 12), eTypeIsStructUnion = (1u << 13),
1043 eTypeIsTemplate = (1u << 14), eTypeIsTypedef = (1u << 15),
1044 eTypeIsVector = (1u << 16), eTypeIsScalar = (1u << 17),
1045 eTypeIsInteger = (1u << 18), eTypeIsFloat = (1u << 19),
1046 eTypeIsComplex = (1u << 20), eTypeIsSigned = (1u << 21),
1047 eTypeInstanceIsPointer = (1u << 22)};
1049 FLAGS_ENUM(CommandFlags){
1050 //----------------------------------------------------------------------
1051 // eCommandRequiresTarget
1053 // Ensures a valid target is contained in m_exe_ctx prior to executing the
1054 // command. If a target doesn't exist or is invalid, the command will fail
1055 // and CommandObject::GetInvalidTargetDescription() will be returned as the
1056 // error. CommandObject subclasses can override the virtual function for
1057 // GetInvalidTargetDescription() to provide custom strings when needed.
1058 //----------------------------------------------------------------------
1059 eCommandRequiresTarget = (1u << 0),
1060 //----------------------------------------------------------------------
1061 // eCommandRequiresProcess
1063 // Ensures a valid process is contained in m_exe_ctx prior to executing the
1064 // command. If a process doesn't exist or is invalid, the command will fail
1065 // and CommandObject::GetInvalidProcessDescription() will be returned as
1066 // the error. CommandObject subclasses can override the virtual function
1067 // for GetInvalidProcessDescription() to provide custom strings when
1069 //----------------------------------------------------------------------
1070 eCommandRequiresProcess = (1u << 1),
1071 //----------------------------------------------------------------------
1072 // eCommandRequiresThread
1074 // Ensures a valid thread is contained in m_exe_ctx prior to executing the
1075 // command. If a thread doesn't exist or is invalid, the command will fail
1076 // and CommandObject::GetInvalidThreadDescription() will be returned as the
1077 // error. CommandObject subclasses can override the virtual function for
1078 // GetInvalidThreadDescription() to provide custom strings when needed.
1079 //----------------------------------------------------------------------
1080 eCommandRequiresThread = (1u << 2),
1081 //----------------------------------------------------------------------
1082 // eCommandRequiresFrame
1084 // Ensures a valid frame is contained in m_exe_ctx prior to executing the
1085 // command. If a frame doesn't exist or is invalid, the command will fail
1086 // and CommandObject::GetInvalidFrameDescription() will be returned as the
1087 // error. CommandObject subclasses can override the virtual function for
1088 // GetInvalidFrameDescription() to provide custom strings when needed.
1089 //----------------------------------------------------------------------
1090 eCommandRequiresFrame = (1u << 3),
1091 //----------------------------------------------------------------------
1092 // eCommandRequiresRegContext
1094 // Ensures a valid register context (from the selected frame if there is a
1095 // frame in m_exe_ctx, or from the selected thread from m_exe_ctx) is
1096 // available from m_exe_ctx prior to executing the command. If a target
1097 // doesn't exist or is invalid, the command will fail and
1098 // CommandObject::GetInvalidRegContextDescription() will be returned as the
1099 // error. CommandObject subclasses can override the virtual function for
1100 // GetInvalidRegContextDescription() to provide custom strings when needed.
1101 //----------------------------------------------------------------------
1102 eCommandRequiresRegContext = (1u << 4),
1103 //----------------------------------------------------------------------
1104 // eCommandTryTargetAPILock
1106 // Attempts to acquire the target lock if a target is selected in the
1107 // command interpreter. If the command object fails to acquire the API
1108 // lock, the command will fail with an appropriate error message.
1109 //----------------------------------------------------------------------
1110 eCommandTryTargetAPILock = (1u << 5),
1111 //----------------------------------------------------------------------
1112 // eCommandProcessMustBeLaunched
1114 // Verifies that there is a launched process in m_exe_ctx, if there isn't,
1115 // the command will fail with an appropriate error message.
1116 //----------------------------------------------------------------------
1117 eCommandProcessMustBeLaunched = (1u << 6),
1118 //----------------------------------------------------------------------
1119 // eCommandProcessMustBePaused
1121 // Verifies that there is a paused process in m_exe_ctx, if there isn't,
1122 // the command will fail with an appropriate error message.
1123 //----------------------------------------------------------------------
1124 eCommandProcessMustBePaused = (1u << 7)};
1126 //----------------------------------------------------------------------
1127 // Whether a summary should cap how much data it returns to users or not
1128 //----------------------------------------------------------------------
1129 enum TypeSummaryCapping {
1130 eTypeSummaryCapped = true,
1131 eTypeSummaryUncapped = false
1135 #endif // LLDB_lldb_enumerations_h_