lldb-enumerations.h revision 443bd7585f160e06a66be9f704b7c292c63c8351
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_enumerations_h_
11#define LLDB_enumerations_h_
12
13#if !defined (__APPLE__)
14
15#include <endian.h>
16
17#endif
18
19namespace lldb {
20
21//----------------------------------------------------------------------
22// Process and Thread States
23//----------------------------------------------------------------------
24typedef enum StateType
25{
26    eStateInvalid = 0,
27    eStateUnloaded,
28    eStateAttaching,
29    eStateLaunching,
30    eStateStopped,
31    eStateRunning,
32    eStateStepping,
33    eStateCrashed,
34    eStateDetached,
35    eStateExited,
36    eStateSuspended
37} StateType;
38
39//----------------------------------------------------------------------
40// Thread Step Types
41//----------------------------------------------------------------------
42typedef enum StepType
43{
44    eStepTypeNone,
45    eStepTypeTrace,     ///< Single step one instruction.
46    eStepTypeTraceOver, ///< Single step one instruction, stepping over.
47    eStepTypeInto,      ///< Single step into a specified context.
48    eStepTypeOver,      ///< Single step over a specified context.
49    eStepTypeOut        ///< Single step out a specified context.
50} StepType;
51
52//----------------------------------------------------------------------
53// Launch Flags
54//----------------------------------------------------------------------
55typedef enum LaunchFlags
56{
57    eLaunchFlagNone         = 0u,
58    eLaunchFlagDisableASLR  = (1u << 0),  ///< Disable Address Space Layout Randomization
59    eLaunchFlagDisableSTDIO = (1u << 1),  ///< Disable stdio for inferior process (e.g. for a GUI app)
60    eLaunchFlagLaunchInTTY  = (1u << 2)   ///< Launch the process in a new TTY if supported by the host
61} LaunchFlags;
62
63//----------------------------------------------------------------------
64// Thread Run Modes
65//----------------------------------------------------------------------
66typedef enum RunMode {
67    eOnlyThisThread,
68    eAllThreads,
69    eOnlyDuringStepping
70} RunMode;
71
72//----------------------------------------------------------------------
73// Address Types
74//----------------------------------------------------------------------
75typedef enum AddressType
76{
77    eAddressTypeInvalid = 0,
78    eAddressTypeFile, ///< Address is an address as found in an object or symbol file
79    eAddressTypeLoad, ///< Address is an address as in the current target inferior process
80    eAddressTypeHost  ///< Address is an address in the process that is running this code
81} AddressType;
82
83//----------------------------------------------------------------------
84// Byte ordering definitions
85//----------------------------------------------------------------------
86typedef enum ByteOrder
87{
88    eByteOrderInvalid   = 0,
89    eByteOrderLittle    = 1234,
90    eByteOrderBig       = 4321,
91    eByteOrderPDP       = 3412,
92
93#if defined (__APPLE__)
94
95// On Mac OS X there are preprocessor defines automatically defined
96// for the byte order that we can rely on.
97
98#if   defined (__LITTLE_ENDIAN__)
99    eByteOrderHost      = eByteOrderLittle
100#elif defined (__BIG_ENDIAN__)
101    eByteOrderHost      = eByteOrderBig
102#elif defined (__PDP_ENDIAN__)
103    eByteOrderHost      = eByteOrderPDP
104#else
105#error unable to detect endianness
106#endif
107
108#else
109
110// On linux we rely upon the defines in <endian.h>
111
112#if __BYTE_ORDER == __LITTLE_ENDIAN
113    eByteOrderHost      = eByteOrderLittle
114#elif __BYTE_ORDER == __BIG_ENDIAN
115    eByteOrderHost      = eByteOrderBig
116#elif __BYTE_ORDER == __PDP_ENDIAN
117    eByteOrderHost      = eByteOrderPDP
118#else
119#error unable to detect endianness
120#endif
121
122#endif
123
124} ByteOrder;
125
126//----------------------------------------------------------------------
127// Register encoding definitions
128//----------------------------------------------------------------------
129typedef enum Encoding
130{
131    eEncodingInvalid = 0,
132    eEncodingUint,               // unsigned integer
133    eEncodingSint,               // signed integer
134    eEncodingIEEE754,            // float
135    eEncodingVector              // vector registers
136} Encoding;
137
138//----------------------------------------------------------------------
139// Display format definitions
140//----------------------------------------------------------------------
141typedef enum Format
142{
143    eFormatDefault = 0,
144    eFormatInvalid = 0,
145    eFormatBoolean,
146    eFormatBinary,
147    eFormatBytes,
148    eFormatBytesWithASCII,
149    eFormatChar,
150    eFormatCharPrintable,   // Only printable characters, space if not printable
151    eFormatComplex,         // Floating point complex type
152    eFormatComplexFloat = eFormatComplex,
153    eFormatCString,         // NULL terminated C strings
154    eFormatDecimal,
155    eFormatEnum,
156    eFormatHex,
157    eFormatFloat,
158    eFormatOctal,
159    eFormatOSType,          // OS character codes encoded into an integer 'PICT' 'text' etc...
160    eFormatUnicode16,
161    eFormatUnicode32,
162    eFormatUnsigned,
163    eFormatPointer,
164    eFormatVectorOfChar,
165    eFormatVectorOfSInt8,
166    eFormatVectorOfUInt8,
167    eFormatVectorOfSInt16,
168    eFormatVectorOfUInt16,
169    eFormatVectorOfSInt32,
170    eFormatVectorOfUInt32,
171    eFormatVectorOfSInt64,
172    eFormatVectorOfUInt64,
173    eFormatVectorOfFloat32,
174    eFormatVectorOfFloat64,
175    eFormatVectorOfUInt128,
176    eFormatComplexInteger   // Integer complex type
177
178} Format;
179
180//----------------------------------------------------------------------
181// Description levels for "void GetDescription(Stream *, DescriptionLevel)" calls
182//----------------------------------------------------------------------
183typedef enum DescriptionLevel
184{
185    eDescriptionLevelBrief = 0,
186    eDescriptionLevelFull,
187    eDescriptionLevelVerbose,
188    kNumDescriptionLevels
189} DescriptionLevel;
190
191//----------------------------------------------------------------------
192// Script interpreter types
193//----------------------------------------------------------------------
194typedef enum ScriptLanguage
195{
196    eScriptLanguageNone,
197    eScriptLanguagePython,
198    eScriptLanguageDefault = eScriptLanguagePython
199} ScriptLanguage;
200
201//----------------------------------------------------------------------
202// Register numbering types
203//----------------------------------------------------------------------
204typedef enum RegisterKind
205{
206    eRegisterKindGCC = 0,    // the register numbers seen in eh_frame
207    eRegisterKindDWARF,      // the register numbers seen DWARF
208    eRegisterKindGeneric,    // insn ptr reg, stack ptr reg, etc not specific to any particular target
209    eRegisterKindGDB,        // the register numbers gdb uses (matches stabs numbers?)
210    eRegisterKindLLDB,       // lldb's internal register numbers
211    kNumRegisterKinds
212} RegisterKind;
213
214//----------------------------------------------------------------------
215// Thread stop reasons
216//----------------------------------------------------------------------
217typedef enum StopReason
218{
219    eStopReasonInvalid = 0,
220    eStopReasonNone,
221    eStopReasonTrace,
222    eStopReasonBreakpoint,
223    eStopReasonWatchpoint,
224    eStopReasonSignal,
225    eStopReasonException,
226    eStopReasonPlanComplete
227} StopReason;
228
229//----------------------------------------------------------------------
230// Votes - Need a tri-state, yes, no, no opinion...
231//----------------------------------------------------------------------
232typedef enum Vote
233{
234    eVoteNo         = -1,
235    eVoteNoOpinion  =  0,
236    eVoteYes        =  1
237} Vote;
238
239//----------------------------------------------------------------------
240// Symbol types
241//----------------------------------------------------------------------
242typedef enum SymbolType
243{
244    eSymbolTypeAny = 0,
245    eSymbolTypeInvalid = 0,
246    eSymbolTypeAbsolute,
247    eSymbolTypeExtern,
248    eSymbolTypeCode,
249    eSymbolTypeData,
250    eSymbolTypeTrampoline,
251    eSymbolTypeRuntime,
252    eSymbolTypeException,
253    eSymbolTypeSourceFile,
254    eSymbolTypeHeaderFile,
255    eSymbolTypeObjectFile,
256    eSymbolTypeCommonBlock,
257    eSymbolTypeBlock,
258    eSymbolTypeLocal,
259    eSymbolTypeParam,
260    eSymbolTypeVariable,
261    eSymbolTypeVariableType,
262    eSymbolTypeLineEntry,
263    eSymbolTypeLineHeader,
264    eSymbolTypeScopeBegin,
265    eSymbolTypeScopeEnd,
266    eSymbolTypeAdditional, // When symbols take more than one entry, the extra entries get this type
267    eSymbolTypeCompiler,
268    eSymbolTypeInstrumentation,
269    eSymbolTypeUndefined
270} SymbolType;
271
272
273//----------------------------------------------------------------------
274// Command Return Status Types
275//----------------------------------------------------------------------
276typedef enum ReturnStatus
277{
278    eReturnStatusInvalid,
279    eReturnStatusSuccessFinishNoResult,
280    eReturnStatusSuccessFinishResult,
281    eReturnStatusSuccessContinuingNoResult,
282    eReturnStatusSuccessContinuingResult,
283    eReturnStatusStarted,
284    eReturnStatusFailed,
285    eReturnStatusQuit
286} ReturnStatus;
287
288
289//----------------------------------------------------------------------
290// Connection Status Types
291//----------------------------------------------------------------------
292typedef enum ConnectionStatus
293{
294    eConnectionStatusSuccess,         // Success
295    eConnectionStatusEndOfFile,       // End-of-file encountered
296    eConnectionStatusError,           // Check GetError() for details
297    eConnectionStatusTimedOut,        // Request timed out
298    eConnectionStatusNoConnection,    // No connection
299    eConnectionStatusLostConnection   // Lost connection while connected to a valid connection
300} ConnectionStatus;
301
302
303typedef enum ErrorType
304{
305    eErrorTypeInvalid,
306    eErrorTypeGeneric,      ///< Generic errors that can be any value.
307    eErrorTypeMachKernel,   ///< Mach kernel error codes.
308    eErrorTypePOSIX         ///< POSIX error codes.
309} ErrorType;
310
311
312typedef enum ValueType
313{
314    eValueTypeInvalid           = 0,
315    eValueTypeVariableGlobal    = 1,    // globals variable
316    eValueTypeVariableStatic    = 2,    // static variable
317    eValueTypeVariableArgument  = 3,    // function argument variables
318    eValueTypeVariableLocal     = 4,    // function local variables
319    eValueTypeRegister          = 5,    // stack frame register value
320    eValueTypeRegisterSet       = 6,    // A collection of stack frame register values
321    eValueTypeConstResult       = 7     // constant result variables
322} ValueType;
323
324//----------------------------------------------------------------------
325// Token size/granularities for Input Readers
326//----------------------------------------------------------------------
327
328typedef enum InputReaderGranularity
329{
330    eInputReaderGranularityInvalid = 0,
331    eInputReaderGranularityByte,
332    eInputReaderGranularityWord,
333    eInputReaderGranularityLine,
334    eInputReaderGranularityAll
335} InputReaderGranularity;
336
337//------------------------------------------------------------------
338/// These mask bits allow a common interface for queries that can
339/// limit the amount of information that gets parsed to only the
340/// information that is requested. These bits also can indicate what
341/// actually did get resolved during query function calls.
342///
343/// Each definition corresponds to a one of the member variables
344/// in this class, and requests that that item be resolved, or
345/// indicates that the member did get resolved.
346//------------------------------------------------------------------
347typedef enum SymbolContextItem
348{
349    eSymbolContextTarget     = (1 << 0), ///< Set when \a target is requested from a query, or was located in query results
350    eSymbolContextModule     = (1 << 1), ///< Set when \a module is requested from a query, or was located in query results
351    eSymbolContextCompUnit   = (1 << 2), ///< Set when \a comp_unit is requested from a query, or was located in query results
352    eSymbolContextFunction   = (1 << 3), ///< Set when \a function is requested from a query, or was located in query results
353    eSymbolContextBlock      = (1 << 4), ///< Set when the deepest \a block is requested from a query, or was located in query results
354    eSymbolContextLineEntry  = (1 << 5), ///< Set when \a line_entry is requested from a query, or was located in query results
355    eSymbolContextSymbol     = (1 << 6), ///< Set when \a symbol is requested from a query, or was located in query results
356    eSymbolContextEverything = ((eSymbolContextSymbol << 1) - 1)  ///< Indicates to try and lookup everything up during a query.
357} SymbolContextItem;
358
359typedef enum Permissions
360{
361    ePermissionsWritable = (1 << 0),
362    ePermissionsReadable = (1 << 1),
363    ePermissionsExecutable = (1 << 2)
364} Permissions;
365
366typedef enum SectionType
367{
368    eSectionTypeInvalid,
369    eSectionTypeCode,
370    eSectionTypeContainer,              // The section contains child sections
371    eSectionTypeData,
372    eSectionTypeDataCString,            // Inlined C string data
373    eSectionTypeDataCStringPointers,    // Pointers to C string data
374    eSectionTypeDataSymbolAddress,      // Address of a symbol in the symbol table
375    eSectionTypeData4,
376    eSectionTypeData8,
377    eSectionTypeData16,
378    eSectionTypeDataPointers,
379    eSectionTypeDebug,
380    eSectionTypeZeroFill,
381    eSectionTypeDataObjCMessageRefs,    // Pointer to function pointer + selector
382    eSectionTypeDataObjCCFStrings,      // Objective C const CFString/NSString objects
383    eSectionTypeDWARFDebugAbbrev,
384    eSectionTypeDWARFDebugAranges,
385    eSectionTypeDWARFDebugFrame,
386    eSectionTypeDWARFDebugInfo,
387    eSectionTypeDWARFDebugLine,
388    eSectionTypeDWARFDebugLoc,
389    eSectionTypeDWARFDebugMacInfo,
390    eSectionTypeDWARFDebugPubNames,
391    eSectionTypeDWARFDebugPubTypes,
392    eSectionTypeDWARFDebugRanges,
393    eSectionTypeDWARFDebugStr,
394    eSectionTypeEHFrame,
395    eSectionTypeOther
396
397} SectionType;
398
399
400typedef enum InputReaderAction
401{
402    eInputReaderActivate,   // reader is newly pushed onto the reader stack
403    eInputReaderReactivate, // reader is on top of the stack again after another reader was popped off
404    eInputReaderDeactivate, // another reader was pushed on the stack
405    eInputReaderGotToken,   // reader got one of its tokens (granularity)
406    eInputReaderInterrupt,  // reader received an interrupt signal (probably from a control-c)
407    eInputReaderEndOfFile,  // reader received an EOF char (probably from a control-d)
408    eInputReaderDone        // reader was just popped off the stack and is done
409} InputReaderAction;
410
411
412typedef enum ArchitectureType
413{
414    eArchTypeInvalid,
415    eArchTypeMachO,
416    eArchTypeELF,
417    kNumArchTypes
418} ArchitectureType;
419
420typedef enum FunctionNameType
421{
422    eFunctionNameTypeNone       = 0u,
423    eFunctionNameTypeAuto       = (1u << 1),    // Automatically figure out which FunctionNameType
424                                                // bits to set based on the function name.
425    eFunctionNameTypeFull       = (1u << 2),    // The function name.
426                                                // For C this is the same as just the name of the function
427                                                // For C++ this is the demangled version of the mangled name.
428                                                // For ObjC this is the full function signature with the + or
429                                                // - and the square brackets and the class and selector
430    eFunctionNameTypeBase       = (1u << 3),    // The function name only, no namespaces or arguments and no class
431                                                // methods or selectors will be searched.
432    eFunctionNameTypeMethod     = (1u << 4),    // Find function by method name (C++) with no namespace or arguments
433    eFunctionNameTypeSelector   = (1u << 5)     // Find function by selector name (ObjC) names
434} FunctionNameType;
435
436
437typedef enum BreakpointEventType
438{
439    eBreakpointEventTypeInvalidType         = (1u << 0),
440    eBreakpointEventTypeAdded               = (1u << 1),
441    eBreakpointEventTypeRemoved             = (1u << 2),
442    eBreakpointEventTypeLocationsAdded      = (1u << 3),
443    eBreakpointEventTypeLocationsRemoved    = (1u << 4),
444    eBreakpointEventTypeLocationsResolved   = (1u << 5)
445} BreakpointEventType;
446
447
448//----------------------------------------------------------------------
449/// Programming language type.
450///
451/// These enumerations use the same language enumerations as the DWARF
452/// specification for ease of use and consistency.
453//----------------------------------------------------------------------
454typedef enum LanguageType
455{
456    eLanguageTypeUnknown         = 0x0000,   ///< Unknown or invalid language value.
457    eLanguageTypeC89             = 0x0001,   ///< ISO C:1989.
458    eLanguageTypeC               = 0x0002,   ///< Non-standardized C, such as K&R.
459    eLanguageTypeAda83           = 0x0003,   ///< ISO Ada:1983.
460    eLanguageTypeC_plus_plus     = 0x0004,   ///< ISO C++:1998.
461    eLanguageTypeCobol74         = 0x0005,   ///< ISO Cobol:1974.
462    eLanguageTypeCobol85         = 0x0006,   ///< ISO Cobol:1985.
463    eLanguageTypeFortran77       = 0x0007,   ///< ISO Fortran 77.
464    eLanguageTypeFortran90       = 0x0008,   ///< ISO Fortran 90.
465    eLanguageTypePascal83        = 0x0009,   ///< ISO Pascal:1983.
466    eLanguageTypeModula2         = 0x000a,   ///< ISO Modula-2:1996.
467    eLanguageTypeJava            = 0x000b,   ///< Java.
468    eLanguageTypeC99             = 0x000c,   ///< ISO C:1999.
469    eLanguageTypeAda95           = 0x000d,   ///< ISO Ada:1995.
470    eLanguageTypeFortran95       = 0x000e,   ///< ISO Fortran 95.
471    eLanguageTypePLI             = 0x000f,   ///< ANSI PL/I:1976.
472    eLanguageTypeObjC            = 0x0010,   ///< Objective-C.
473    eLanguageTypeObjC_plus_plus  = 0x0011,   ///< Objective-C++.
474    eLanguageTypeUPC             = 0x0012,   ///< Unified Parallel C.
475    eLanguageTypeD               = 0x0013,   ///< D.
476    eLanguageTypePython          = 0x0014    ///< Python.
477} LanguageType;
478
479
480typedef enum AccessType
481{
482    eAccessNone,
483    eAccessPublic,
484    eAccessPrivate,
485    eAccessProtected,
486    eAccessPackage
487} AccessType;
488
489//----------------------------------------------------------------------
490/// Settable state variable types.
491///
492//----------------------------------------------------------------------
493
494typedef enum SettableVariableType
495{
496    eSetVarTypeInt,
497    eSetVarTypeBoolean,
498    eSetVarTypeString,
499    eSetVarTypeArray,
500    eSetVarTypeDictionary,
501    eSetVarTypeEnum,
502    eSetVarTypeNone
503} SettableVariableType;
504
505typedef enum VarSetOperationType
506{
507    eVarSetOperationReplace,
508    eVarSetOperationInsertBefore,
509    eVarSetOperationInsertAfter,
510    eVarSetOperationRemove,
511    eVarSetOperationAppend,
512    eVarSetOperationClear,
513    eVarSetOperationAssign,
514    eVarSetOperationInvalid
515} VarSetOperationType;
516
517//----------------------------------------------------------------------
518/// Command argument types.
519///
520//----------------------------------------------------------------------
521
522typedef enum CommandArgumentType
523{
524    eArgTypeAddress = 0,
525    eArgTypeAliasName,
526    eArgTypeAliasOptions,
527    eArgTypeArchitecture,
528    eArgTypeBoolean,
529    eArgTypeBreakpointID,
530    eArgTypeBreakpointIDRange,
531    eArgTypeByteSize,
532    eArgTypeCommandName,
533    eArgTypeCount,
534    eArgTypeEndAddress,
535    eArgTypeExpression,
536    eArgTypeExprFormat,
537    eArgTypeFilename,
538    eArgTypeFormat,
539    eArgTypeFrameIndex,
540    eArgTypeFullName,
541    eArgTypeFunctionName,
542    eArgTypeIndex,
543    eArgTypeLineNum,
544    eArgTypeLogCategory,
545    eArgTypeLogChannel,
546    eArgTypeMethod,
547    eArgTypeName,
548    eArgTypeNewPathPrefix,
549    eArgTypeNumLines,
550    eArgTypeNumberPerLine,
551    eArgTypeOffset,
552    eArgTypeOldPathPrefix,
553    eArgTypeOneLiner,
554    eArgTypePath,
555    eArgTypePid,
556    eArgTypePlugin,
557    eArgTypeProcessName,
558    eArgTypeQueueName,
559    eArgTypeRegisterName,
560    eArgTypeRegularExpression,
561    eArgTypeRunArgs,
562    eArgTypeRunMode,
563    eArgTypeScriptLang,
564    eArgTypeSearchWord,
565    eArgTypeSelector,
566    eArgTypeSettingIndex,
567    eArgTypeSettingKey,
568    eArgTypeSettingPrefix,
569    eArgTypeSettingVariableName,
570    eArgTypeShlibName,
571    eArgTypeSourceFile,
572    eArgTypeSortOrder,
573    eArgTypeStartAddress,
574    eArgTypeSymbol,
575    eArgTypeThreadID,
576    eArgTypeThreadIndex,
577    eArgTypeThreadName,
578    eArgTypeUnixSignal,
579    eArgTypeVarName,
580    eArgTypeValue,
581    eArgTypeWidth,
582    eArgTypeNone,
583    eArgTypeLastArg  // Always keep this entry as the last entry in this enumeration!!
584} CommandArgumentType;
585
586typedef enum ArgumentRepetitionType
587{
588    eArgRepeatPlain,            // Exactly one occurrence
589    eArgRepeatOptional,         // At most one occurrence, but it's optional
590    eArgRepeatPlus,             // One or more occurrences
591    eArgRepeatStar,             // Zero or more occurrences
592    eArgRepeatRange,            // Repetition of same argument, from 1 to n
593    eArgRepeatPairPlain,        // A pair of arguments that must always go together ([arg-type arg-value]), occurs exactly once
594    eArgRepeatPairOptional,     // A pair that occurs at most once (optional)
595    eArgRepeatPairPlus,         // One or more occurrences of a pair
596    eArgRepeatPairStar,         // Zero or more occurrences of a pair
597    eArgRepeatPairRange,        // A pair that repeats from 1 to n
598    eArgRepeatPairRangeOptional // A pair that repeats from 1 to n, but is optional
599} ArgumentRepetitionType;
600
601typedef enum SortOrder
602{
603    eSortOrderNone,
604    eSortOrderByAddress,
605    eSortOrderByName
606} SortOrder;
607
608
609//----------------------------------------------------------------------
610// Used in conjunction with Host::GetLLDBResource () to find files that
611// are related to
612//----------------------------------------------------------------------
613typedef enum PathType
614{
615    ePathTypeLLDBShlibDir,          // The directory where the lldb.so (unix) or LLDB mach-o file in LLDB.framework (MacOSX) exists
616    ePathTypeSupportExecutableDir,  // Find LLDB support executable directory (debugserver, etc)
617    ePathTypeHeaderDir,             // Find LLDB header file directory
618    ePathTypePythonDir              // Find Python modules (PYTHONPATH) directory
619} PathType;
620
621
622//----------------------------------------------------------------------
623// We can execute ThreadPlans on one thread with various fall-back modes
624// (try other threads after timeout, etc.) This enum gives the result of
625// thread plan executions.
626//----------------------------------------------------------------------
627typedef enum ExecutionResults
628{
629    eExecutionSetupError,
630    eExecutionCompleted,
631    eExecutionDiscarded,
632    eExecutionInterrupted,
633    eExecutionTimedOut
634} ExecutionResults;
635
636typedef enum ObjCRuntimeVersions {
637    eObjC_VersionUnknown = 0,
638    eAppleObjC_V1 = 1,
639    eAppleObjC_V2 = 2
640} ObjCRuntimeVersions;
641
642} // namespace lldb
643
644
645#endif  // LLDB_enumerations_h_
646