lldb-enumerations.h revision c8cf5e234be554d4acb6ae644a8269c303c4f56e
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
13namespace lldb {
14
15    //----------------------------------------------------------------------
16    // Process and Thread States
17    //----------------------------------------------------------------------
18    typedef enum StateType
19    {
20        eStateInvalid = 0,
21        eStateUnloaded,     ///< Process is object is valid, but not currently loaded
22        eStateConnected,    ///< Process is connected to remote debug services, but not launched or attached to anything yet
23        eStateAttaching,    ///< Process is currently trying to attach
24        eStateLaunching,    ///< Process is in the process of launching
25        eStateStopped,      ///< Process or thread is stopped and can be examined.
26        eStateRunning,      ///< Process or thread is running and can't be examined.
27        eStateStepping,     ///< Process or thread is in the process of stepping and can not be examined.
28        eStateCrashed,      ///< Process or thread has crashed and can be examined.
29        eStateDetached,     ///< Process has been detached and can't be examined.
30        eStateExited,       ///< Process has exited and can't be examined.
31        eStateSuspended     ///< Process or thread is in a suspended state as far
32                            ///< as the debugger is concerned while other processes
33                            ///< or threads get the chance to run.
34    } StateType;
35
36    //----------------------------------------------------------------------
37    // Launch Flags
38    //----------------------------------------------------------------------
39    typedef enum LaunchFlags
40    {
41        eLaunchFlagNone         = 0u,
42        eLaunchFlagExec         = (1u << 0),  ///< Exec when launching and turn the calling process into a new process
43        eLaunchFlagDebug        = (1u << 1),  ///< Stop as soon as the process launches to allow the process to be debugged
44        eLaunchFlagStopAtEntry  = (1u << 2),  ///< Stop at the program entry point instead of auto-continuing when launching or attaching at entry point
45        eLaunchFlagDisableASLR  = (1u << 3),  ///< Disable Address Space Layout Randomization
46        eLaunchFlagDisableSTDIO = (1u << 4),  ///< Disable stdio for inferior process (e.g. for a GUI app)
47        eLaunchFlagLaunchInTTY  = (1u << 5)   ///< Launch the process in a new TTY if supported by the host
48    } LaunchFlags;
49
50    //----------------------------------------------------------------------
51    // Thread Run Modes
52    //----------------------------------------------------------------------
53    typedef enum RunMode {
54        eOnlyThisThread,
55        eAllThreads,
56        eOnlyDuringStepping
57    } RunMode;
58
59    //----------------------------------------------------------------------
60    // Byte ordering definitions
61    //----------------------------------------------------------------------
62    typedef enum ByteOrder
63    {
64        eByteOrderInvalid   = 0,
65        eByteOrderBig       = 1,
66        eByteOrderPDP       = 2,
67        eByteOrderLittle    = 4
68    } ByteOrder;
69
70    //----------------------------------------------------------------------
71    // Register encoding definitions
72    //----------------------------------------------------------------------
73    typedef enum Encoding
74    {
75        eEncodingInvalid = 0,
76        eEncodingUint,               // unsigned integer
77        eEncodingSint,               // signed integer
78        eEncodingIEEE754,            // float
79        eEncodingVector              // vector registers
80    } Encoding;
81
82    //----------------------------------------------------------------------
83    // Display format definitions
84    //----------------------------------------------------------------------
85    typedef enum Format
86    {
87        eFormatDefault = 0,
88        eFormatInvalid = 0,
89        eFormatBoolean,
90        eFormatBinary,
91        eFormatBytes,
92        eFormatBytesWithASCII,
93        eFormatChar,
94        eFormatCharPrintable,   // Only printable characters, space if not printable
95        eFormatComplex,         // Floating point complex type
96        eFormatComplexFloat = eFormatComplex,
97        eFormatCString,         // NULL terminated C strings
98        eFormatDecimal,
99        eFormatEnum,
100        eFormatHex,
101        eFormatFloat,
102        eFormatOctal,
103        eFormatOSType,          // OS character codes encoded into an integer 'PICT' 'text' etc...
104        eFormatUnicode16,
105        eFormatUnicode32,
106        eFormatUnsigned,
107        eFormatPointer,
108        eFormatVectorOfChar,
109        eFormatVectorOfSInt8,
110        eFormatVectorOfUInt8,
111        eFormatVectorOfSInt16,
112        eFormatVectorOfUInt16,
113        eFormatVectorOfSInt32,
114        eFormatVectorOfUInt32,
115        eFormatVectorOfSInt64,
116        eFormatVectorOfUInt64,
117        eFormatVectorOfFloat32,
118        eFormatVectorOfFloat64,
119        eFormatVectorOfUInt128,
120        eFormatComplexInteger,   // Integer complex type
121        eFormatCharArray,       // Print characters with no single quotes, used for character arrays that can contain non printable characters
122        kNumFormats
123    } Format;
124
125    //----------------------------------------------------------------------
126    // Description levels for "void GetDescription(Stream *, DescriptionLevel)" calls
127    //----------------------------------------------------------------------
128    typedef enum DescriptionLevel
129    {
130        eDescriptionLevelBrief = 0,
131        eDescriptionLevelFull,
132        eDescriptionLevelVerbose,
133        kNumDescriptionLevels
134    } DescriptionLevel;
135
136    //----------------------------------------------------------------------
137    // Script interpreter types
138    //----------------------------------------------------------------------
139    typedef enum ScriptLanguage
140    {
141        eScriptLanguageNone,
142        eScriptLanguagePython,
143        eScriptLanguageDefault = eScriptLanguagePython
144    } ScriptLanguage;
145
146    //----------------------------------------------------------------------
147    // Register numbering types
148    //----------------------------------------------------------------------
149    typedef enum RegisterKind
150    {
151        eRegisterKindGCC = 0,    // the register numbers seen in eh_frame
152        eRegisterKindDWARF,      // the register numbers seen DWARF
153        eRegisterKindGeneric,    // insn ptr reg, stack ptr reg, etc not specific to any particular target
154        eRegisterKindGDB,        // the register numbers gdb uses (matches stabs numbers?)
155        eRegisterKindLLDB,       // lldb's internal register numbers
156        kNumRegisterKinds
157    } RegisterKind;
158
159    //----------------------------------------------------------------------
160    // Thread stop reasons
161    //----------------------------------------------------------------------
162    typedef enum StopReason
163    {
164        eStopReasonInvalid = 0,
165        eStopReasonNone,
166        eStopReasonTrace,
167        eStopReasonBreakpoint,
168        eStopReasonWatchpoint,
169        eStopReasonSignal,
170        eStopReasonException,
171        eStopReasonPlanComplete
172    } StopReason;
173
174    //----------------------------------------------------------------------
175    // Command Return Status Types
176    //----------------------------------------------------------------------
177    typedef enum ReturnStatus
178    {
179        eReturnStatusInvalid,
180        eReturnStatusSuccessFinishNoResult,
181        eReturnStatusSuccessFinishResult,
182        eReturnStatusSuccessContinuingNoResult,
183        eReturnStatusSuccessContinuingResult,
184        eReturnStatusStarted,
185        eReturnStatusFailed,
186        eReturnStatusQuit
187    } ReturnStatus;
188
189
190    //----------------------------------------------------------------------
191    // Connection Status Types
192    //----------------------------------------------------------------------
193    typedef enum ConnectionStatus
194    {
195        eConnectionStatusSuccess,         // Success
196        eConnectionStatusEndOfFile,       // End-of-file encountered
197        eConnectionStatusError,           // Check GetError() for details
198        eConnectionStatusTimedOut,        // Request timed out
199        eConnectionStatusNoConnection,    // No connection
200        eConnectionStatusLostConnection   // Lost connection while connected to a valid connection
201    } ConnectionStatus;
202
203    typedef enum ErrorType
204    {
205        eErrorTypeInvalid,
206        eErrorTypeGeneric,      ///< Generic errors that can be any value.
207        eErrorTypeMachKernel,   ///< Mach kernel error codes.
208        eErrorTypePOSIX         ///< POSIX error codes.
209    } ErrorType;
210
211
212    typedef enum ValueType
213    {
214        eValueTypeInvalid           = 0,
215        eValueTypeVariableGlobal    = 1,    // globals variable
216        eValueTypeVariableStatic    = 2,    // static variable
217        eValueTypeVariableArgument  = 3,    // function argument variables
218        eValueTypeVariableLocal     = 4,    // function local variables
219        eValueTypeRegister          = 5,    // stack frame register value
220        eValueTypeRegisterSet       = 6,    // A collection of stack frame register values
221        eValueTypeConstResult       = 7     // constant result variables
222    } ValueType;
223
224    //----------------------------------------------------------------------
225    // Token size/granularities for Input Readers
226    //----------------------------------------------------------------------
227
228    typedef enum InputReaderGranularity
229    {
230        eInputReaderGranularityInvalid = 0,
231        eInputReaderGranularityByte,
232        eInputReaderGranularityWord,
233        eInputReaderGranularityLine,
234        eInputReaderGranularityAll
235    } InputReaderGranularity;
236
237    //------------------------------------------------------------------
238    /// These mask bits allow a common interface for queries that can
239    /// limit the amount of information that gets parsed to only the
240    /// information that is requested. These bits also can indicate what
241    /// actually did get resolved during query function calls.
242    ///
243    /// Each definition corresponds to a one of the member variables
244    /// in this class, and requests that that item be resolved, or
245    /// indicates that the member did get resolved.
246    //------------------------------------------------------------------
247    typedef enum SymbolContextItem
248    {
249        eSymbolContextTarget     = (1 << 0), ///< Set when \a target is requested from a query, or was located in query results
250        eSymbolContextModule     = (1 << 1), ///< Set when \a module is requested from a query, or was located in query results
251        eSymbolContextCompUnit   = (1 << 2), ///< Set when \a comp_unit is requested from a query, or was located in query results
252        eSymbolContextFunction   = (1 << 3), ///< Set when \a function is requested from a query, or was located in query results
253        eSymbolContextBlock      = (1 << 4), ///< Set when the deepest \a block is requested from a query, or was located in query results
254        eSymbolContextLineEntry  = (1 << 5), ///< Set when \a line_entry is requested from a query, or was located in query results
255        eSymbolContextSymbol     = (1 << 6), ///< Set when \a symbol is requested from a query, or was located in query results
256        eSymbolContextEverything = ((eSymbolContextSymbol << 1) - 1)  ///< Indicates to try and lookup everything up during a query.
257    } SymbolContextItem;
258
259    typedef enum Permissions
260    {
261        ePermissionsWritable = (1 << 0),
262        ePermissionsReadable = (1 << 1),
263        ePermissionsExecutable = (1 << 2)
264    } Permissions;
265
266    typedef enum InputReaderAction
267    {
268        eInputReaderActivate,   // reader is newly pushed onto the reader stack
269        eInputReaderAsynchronousOutputWritten, // an async output event occurred; the reader may want to do something
270        eInputReaderReactivate, // reader is on top of the stack again after another reader was popped off
271        eInputReaderDeactivate, // another reader was pushed on the stack
272        eInputReaderGotToken,   // reader got one of its tokens (granularity)
273        eInputReaderInterrupt,  // reader received an interrupt signal (probably from a control-c)
274        eInputReaderEndOfFile,  // reader received an EOF char (probably from a control-d)
275        eInputReaderDone        // reader was just popped off the stack and is done
276    } InputReaderAction;
277
278    typedef enum BreakpointEventType
279    {
280        eBreakpointEventTypeInvalidType         = (1u << 0),
281        eBreakpointEventTypeAdded               = (1u << 1),
282        eBreakpointEventTypeRemoved             = (1u << 2),
283        eBreakpointEventTypeLocationsAdded      = (1u << 3),
284        eBreakpointEventTypeLocationsRemoved    = (1u << 4),
285        eBreakpointEventTypeLocationsResolved   = (1u << 5)
286    } BreakpointEventType;
287
288
289    //----------------------------------------------------------------------
290    /// Programming language type.
291    ///
292    /// These enumerations use the same language enumerations as the DWARF
293    /// specification for ease of use and consistency.
294    //----------------------------------------------------------------------
295    typedef enum LanguageType
296    {
297        eLanguageTypeUnknown         = 0x0000,   ///< Unknown or invalid language value.
298        eLanguageTypeC89             = 0x0001,   ///< ISO C:1989.
299        eLanguageTypeC               = 0x0002,   ///< Non-standardized C, such as K&R.
300        eLanguageTypeAda83           = 0x0003,   ///< ISO Ada:1983.
301        eLanguageTypeC_plus_plus     = 0x0004,   ///< ISO C++:1998.
302        eLanguageTypeCobol74         = 0x0005,   ///< ISO Cobol:1974.
303        eLanguageTypeCobol85         = 0x0006,   ///< ISO Cobol:1985.
304        eLanguageTypeFortran77       = 0x0007,   ///< ISO Fortran 77.
305        eLanguageTypeFortran90       = 0x0008,   ///< ISO Fortran 90.
306        eLanguageTypePascal83        = 0x0009,   ///< ISO Pascal:1983.
307        eLanguageTypeModula2         = 0x000a,   ///< ISO Modula-2:1996.
308        eLanguageTypeJava            = 0x000b,   ///< Java.
309        eLanguageTypeC99             = 0x000c,   ///< ISO C:1999.
310        eLanguageTypeAda95           = 0x000d,   ///< ISO Ada:1995.
311        eLanguageTypeFortran95       = 0x000e,   ///< ISO Fortran 95.
312        eLanguageTypePLI             = 0x000f,   ///< ANSI PL/I:1976.
313        eLanguageTypeObjC            = 0x0010,   ///< Objective-C.
314        eLanguageTypeObjC_plus_plus  = 0x0011,   ///< Objective-C++.
315        eLanguageTypeUPC             = 0x0012,   ///< Unified Parallel C.
316        eLanguageTypeD               = 0x0013,   ///< D.
317        eLanguageTypePython          = 0x0014    ///< Python.
318    } LanguageType;
319
320    typedef enum DynamicValueType
321    {
322        eNoDynamicValues = 0,
323        eDynamicCanRunTarget    = 1,
324        eDynamicDontRunTarget   = 2
325    } DynamicValueType;
326
327    typedef enum SyntheticValueType
328    {
329        eNoSyntheticFilter = false,
330        eUseSyntheticFilter = true
331    } SyntheticValueType;
332
333    typedef enum AccessType
334    {
335        eAccessNone,
336        eAccessPublic,
337        eAccessPrivate,
338        eAccessProtected,
339        eAccessPackage
340    } AccessType;
341
342    typedef enum CommandArgumentType
343    {
344        eArgTypeAddress = 0,
345        eArgTypeAliasName,
346        eArgTypeAliasOptions,
347        eArgTypeArchitecture,
348        eArgTypeBoolean,
349        eArgTypeBreakpointID,
350        eArgTypeBreakpointIDRange,
351        eArgTypeByteSize,
352        eArgTypeClassName,
353        eArgTypeCommandName,
354        eArgTypeCount,
355        eArgTypeEndAddress,
356        eArgTypeExpression,
357        eArgTypeExprFormat,
358        eArgTypeFilename,
359        eArgTypeFormat,
360        eArgTypeFrameIndex,
361        eArgTypeFullName,
362        eArgTypeFunctionName,
363        eArgTypeIndex,
364        eArgTypeLineNum,
365        eArgTypeLogCategory,
366        eArgTypeLogChannel,
367        eArgTypeMethod,
368        eArgTypeName,
369        eArgTypeNewPathPrefix,
370        eArgTypeNumLines,
371        eArgTypeNumberPerLine,
372        eArgTypeOffset,
373        eArgTypeOldPathPrefix,
374        eArgTypeOneLiner,
375        eArgTypePath,
376        eArgTypePid,
377        eArgTypePlugin,
378        eArgTypeProcessName,
379        eArgTypeQueueName,
380        eArgTypeRegisterName,
381        eArgTypeRegularExpression,
382        eArgTypeRunArgs,
383        eArgTypeRunMode,
384        eArgTypeScriptLang,
385        eArgTypeSearchWord,
386        eArgTypeSelector,
387        eArgTypeSettingIndex,
388        eArgTypeSettingKey,
389        eArgTypeSettingPrefix,
390        eArgTypeSettingVariableName,
391        eArgTypeShlibName,
392        eArgTypeSourceFile,
393        eArgTypeSortOrder,
394        eArgTypeStartAddress,
395        eArgTypeSummaryString,
396        eArgTypeSymbol,
397        eArgTypeThreadID,
398        eArgTypeThreadIndex,
399        eArgTypeThreadName,
400        eArgTypeUnsignedInteger,
401        eArgTypeUnixSignal,
402        eArgTypeVarName,
403        eArgTypeValue,
404        eArgTypeWidth,
405        eArgTypeNone,
406        eArgTypePlatform,
407        eArgTypeLastArg  // Always keep this entry as the last entry in this enumeration!!
408    } CommandArgumentType;
409
410    //----------------------------------------------------------------------
411    // Symbol types
412    //----------------------------------------------------------------------
413    typedef enum SymbolType
414    {
415        eSymbolTypeAny = 0,
416        eSymbolTypeInvalid = 0,
417        eSymbolTypeAbsolute,
418        eSymbolTypeExtern,
419        eSymbolTypeCode,
420        eSymbolTypeData,
421        eSymbolTypeTrampoline,
422        eSymbolTypeRuntime,
423        eSymbolTypeException,
424        eSymbolTypeSourceFile,
425        eSymbolTypeHeaderFile,
426        eSymbolTypeObjectFile,
427        eSymbolTypeCommonBlock,
428        eSymbolTypeBlock,
429        eSymbolTypeLocal,
430        eSymbolTypeParam,
431        eSymbolTypeVariable,
432        eSymbolTypeVariableType,
433        eSymbolTypeLineEntry,
434        eSymbolTypeLineHeader,
435        eSymbolTypeScopeBegin,
436        eSymbolTypeScopeEnd,
437        eSymbolTypeAdditional, // When symbols take more than one entry, the extra entries get this type
438        eSymbolTypeCompiler,
439        eSymbolTypeInstrumentation,
440        eSymbolTypeUndefined
441    } SymbolType;
442
443    typedef enum SectionType
444    {
445        eSectionTypeInvalid,
446        eSectionTypeCode,
447        eSectionTypeContainer,              // The section contains child sections
448        eSectionTypeData,
449        eSectionTypeDataCString,            // Inlined C string data
450        eSectionTypeDataCStringPointers,    // Pointers to C string data
451        eSectionTypeDataSymbolAddress,      // Address of a symbol in the symbol table
452        eSectionTypeData4,
453        eSectionTypeData8,
454        eSectionTypeData16,
455        eSectionTypeDataPointers,
456        eSectionTypeDebug,
457        eSectionTypeZeroFill,
458        eSectionTypeDataObjCMessageRefs,    // Pointer to function pointer + selector
459        eSectionTypeDataObjCCFStrings,      // Objective C const CFString/NSString objects
460        eSectionTypeDWARFDebugAbbrev,
461        eSectionTypeDWARFDebugAranges,
462        eSectionTypeDWARFDebugFrame,
463        eSectionTypeDWARFDebugInfo,
464        eSectionTypeDWARFDebugLine,
465        eSectionTypeDWARFDebugLoc,
466        eSectionTypeDWARFDebugMacInfo,
467        eSectionTypeDWARFDebugPubNames,
468        eSectionTypeDWARFDebugPubTypes,
469        eSectionTypeDWARFDebugRanges,
470        eSectionTypeDWARFDebugStr,
471        eSectionTypeDWARFDebugNames,
472        eSectionTypeDWARFDebugTypes,
473        eSectionTypeEHFrame,
474        eSectionTypeOther
475
476    } SectionType;
477
478    typedef enum EmulateInstructionOptions
479    {
480        eEmulateInstructionOptionNone               = (0u),
481        eEmulateInstructionOptionAutoAdvancePC      = (1u << 0),
482        eEmulateInstructionOptionIgnoreConditions   = (1u << 1)
483    } EmulateInstructionOptions;
484
485    typedef enum FunctionNameType
486    {
487        eFunctionNameTypeNone       = 0u,
488        eFunctionNameTypeAuto       = (1u << 1),    // Automatically figure out which FunctionNameType
489                                                    // bits to set based on the function name.
490        eFunctionNameTypeFull       = (1u << 2),    // The function name.
491                                                    // For C this is the same as just the name of the function
492                                                    // For C++ this is the mangled or demangled version of the mangled name.
493                                                    // For ObjC this is the full function signature with the + or
494                                                    // - and the square brackets and the class and selector
495        eFunctionNameTypeBase       = (1u << 3),    // The function name only, no namespaces or arguments and no class
496                                                    // methods or selectors will be searched.
497        eFunctionNameTypeMethod     = (1u << 4),    // Find function by method name (C++) with no namespace or arguments
498        eFunctionNameTypeSelector   = (1u << 5)     // Find function by selector name (ObjC) names
499    } FunctionNameType;
500
501    //----------------------------------------------------------------------
502    // Ways that the FormatManager picks a particular format for a type
503    //----------------------------------------------------------------------
504    typedef enum FormatterChoiceCriterion
505    {
506        eFormatterChoiceCriterionDirectChoice =                  0x00000000,
507        eFormatterChoiceCriterionStrippedPointerReference =      0x00000001,
508        eFormatterChoiceCriterionNavigatedTypedefs =             0x00000002,
509        eFormatterChoiceCriterionNavigatedBaseClasses =          0x00000004,
510        eFormatterChoiceCriterionRegularExpressionSummary =      0x00000008,
511        eFormatterChoiceCriterionRegularExpressionFilter =       0x00000008,
512        eFormatterChoiceCriterionDynamicObjCHierarchy =          0x00000010,
513        eFormatterChoiceCriterionStrippedBitField =              0x00000020
514    } FormatterChoiceCriterion;
515
516    //----------------------------------------------------------------------
517    // Basic types enumeration for the public API SBType::GetBasicType()
518    //----------------------------------------------------------------------
519    typedef enum BasicType
520    {
521		eBasicTypeInvalid = 0,
522        eBasicTypeVoid = 1,
523        eBasicTypeChar,
524        eBasicTypeSignedChar,
525        eBasicTypeWChar,
526        eBasicTypeChar16,
527        eBasicTypeChar32,
528        eBasicTypeShort,
529        eBasicTypeUnsignedShort,
530        eBasicTypeInt,
531        eBasicTypeUnsignedInt,
532        eBasicTypeLong,
533        eBasicTypeUnsignedLong,
534        eBasicTypeLongLong,
535        eBasicTypeUnsignedLongLong,
536        eBasicTypeInt128,
537        eBasicTypeUnsignedInt128,
538        eBasicTypeBool,
539        eBasicTypeFloat,
540        eBasicTypeDouble,
541        eBasicTypeLongDouble,
542        eBasicTypeFloatComplex,
543        eBasicTypeDoubleComplex,
544        eBasicTypeLongDoubleComplex,
545        eBasicTypeObjCID,
546        eBasicTypeObjCClass,
547        eBasicTypeObjCSel
548    } BasicType;
549
550} // namespace lldb
551
552
553#endif  // LLDB_lldb_enumerations_h_
554