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