lldb-enumerations.h revision f2c330df115cfdaedbf9d359b00f3ebb3cab9887
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} LaunchFlags;
60
61//----------------------------------------------------------------------
62// Thread Run Modes
63//----------------------------------------------------------------------
64typedef enum RunMode {
65    eOnlyThisThread,
66    eAllThreads,
67    eOnlyDuringStepping
68} RunMode;
69
70//----------------------------------------------------------------------
71// Address Types
72//----------------------------------------------------------------------
73typedef enum AddressType
74{
75    eAddressTypeInvalid = 0,
76    eAddressTypeFile, ///< Address is an address as found in an object or symbol file
77    eAddressTypeLoad, ///< Address is an address as in the current target inferior process
78    eAddressTypeHost  ///< Address is an address in the process that is running this code
79} AddressType;
80
81//----------------------------------------------------------------------
82// Byte ordering definitions
83//----------------------------------------------------------------------
84typedef enum ByteOrder
85{
86    eByteOrderInvalid   = 0,
87    eByteOrderLittle    = 1234,
88    eByteOrderBig       = 4321,
89    eByteOrderPDP       = 3412,
90
91#if defined (__APPLE__)
92
93// On Mac OS X there are preprocessor defines automatically defined
94// for the byte order that we can rely on.
95
96#if   defined (__LITTLE_ENDIAN__)
97    eByteOrderHost      = eByteOrderLittle
98#elif defined (__BIG_ENDIAN__)
99    eByteOrderHost      = eByteOrderBig
100#elif defined (__PDP_ENDIAN__)
101    eByteOrderHost      = eByteOrderPDP
102#else
103#error unable to detect endianness
104#endif
105
106#else
107
108// On linux we rely upon the defines in <endian.h>
109
110#if __BYTE_ORDER == __LITTLE_ENDIAN
111    eByteOrderHost      = eByteOrderLittle
112#elif __BYTE_ORDER == __BIG_ENDIAN
113    eByteOrderHost      = eByteOrderBig
114#elif __BYTE_ORDER == __PDP_ENDIAN
115    eByteOrderHost      = eByteOrderPDP
116#else
117#error unable to detect endianness
118#endif
119
120#endif
121
122} ByteOrder;
123
124//----------------------------------------------------------------------
125// Register encoding definitions
126//----------------------------------------------------------------------
127typedef enum Encoding
128{
129    eEncodingInvalid = 0,
130    eEncodingUint,               // unsigned integer
131    eEncodingSint,               // signed integer
132    eEncodingIEEE754,            // float
133    eEncodingVector              // vector registers
134} Encoding;
135
136//----------------------------------------------------------------------
137// Display format definitions
138//----------------------------------------------------------------------
139typedef enum Format
140{
141    eFormatDefault = 0,
142    eFormatInvalid = 0,
143    eFormatBoolean,
144    eFormatBinary,
145    eFormatBytes,
146    eFormatBytesWithASCII,
147    eFormatChar,
148    eFormatCharPrintable,   // Only printable characters, space if not printable
149    eFormatComplex,
150    eFormatCString,         // NULL terminated C strings
151    eFormatDecimal,
152    eFormatEnum,
153    eFormatHex,
154    eFormatFloat,
155    eFormatOctal,
156    eFormatUnicode16,
157    eFormatUnicode32,
158    eFormatUnsigned,
159    eFormatPointer,
160    eFormatVectorOfChar,
161    eFormatVectorOfSInt8,
162    eFormatVectorOfUInt8,
163    eFormatVectorOfSInt16,
164    eFormatVectorOfUInt16,
165    eFormatVectorOfSInt32,
166    eFormatVectorOfUInt32,
167    eFormatVectorOfSInt64,
168    eFormatVectorOfUInt64,
169    eFormatVectorOfFloat32,
170    eFormatVectorOfFloat64,
171    eFormatVectorOfUInt128
172
173} Format;
174
175//----------------------------------------------------------------------
176// Description levels for "void GetDescription(Stream *, DescriptionLevel)" calls
177//----------------------------------------------------------------------
178typedef enum DescriptionLevel
179{
180    eDescriptionLevelBrief = 0,
181    eDescriptionLevelFull,
182    eDescriptionLevelVerbose,
183    kNumDescriptionLevels
184} DescriptionLevel;
185
186//----------------------------------------------------------------------
187// Script interpreter types
188//----------------------------------------------------------------------
189typedef enum ScriptLanguage
190{
191    eScriptLanguageNone,
192    eScriptLanguagePython,
193    eScriptLanguageDefault = eScriptLanguagePython
194} ScriptLanguage;
195
196//----------------------------------------------------------------------
197// Register numbering types
198//----------------------------------------------------------------------
199typedef enum RegisterKind
200{
201    eRegisterKindGCC = 0,
202    eRegisterKindDWARF,
203    eRegisterKindGeneric,
204    eRegisterKindGDB,
205    kNumRegisterKinds
206} RegisterKind;
207
208//----------------------------------------------------------------------
209// Thread stop reasons
210//----------------------------------------------------------------------
211typedef enum StopReason
212{
213    eStopReasonInvalid = 0,
214    eStopReasonNone,
215    eStopReasonTrace,
216    eStopReasonBreakpoint,
217    eStopReasonWatchpoint,
218    eStopReasonSignal,
219    eStopReasonException,
220    eStopReasonPlanComplete
221} StopReason;
222
223//----------------------------------------------------------------------
224// Votes - Need a tri-state, yes, no, no opinion...
225//----------------------------------------------------------------------
226typedef enum Vote
227{
228    eVoteNo         = -1,
229    eVoteNoOpinion  =  0,
230    eVoteYes        =  1
231} Vote;
232
233//----------------------------------------------------------------------
234// Symbol types
235//----------------------------------------------------------------------
236typedef enum SymbolType
237{
238    eSymbolTypeAny = 0,
239    eSymbolTypeInvalid = 0,
240    eSymbolTypeAbsolute,
241    eSymbolTypeExtern,
242    eSymbolTypeCode,
243    eSymbolTypeData,
244    eSymbolTypeTrampoline,
245    eSymbolTypeRuntime,
246    eSymbolTypeException,
247    eSymbolTypeSourceFile,
248    eSymbolTypeHeaderFile,
249    eSymbolTypeObjectFile,
250    eSymbolTypeFunction,
251    eSymbolTypeFunctionEnd,
252    eSymbolTypeCommonBlock,
253    eSymbolTypeBlock,
254    eSymbolTypeStatic,
255    eSymbolTypeGlobal,
256    eSymbolTypeLocal,
257    eSymbolTypeParam,
258    eSymbolTypeVariable,
259    eSymbolTypeVariableType,
260    eSymbolTypeLineEntry,
261    eSymbolTypeLineHeader,
262    eSymbolTypeScopeBegin,
263    eSymbolTypeScopeEnd,
264    eSymbolTypeAdditional, // When symbols take more than one entry, the extra entries get this type
265    eSymbolTypeCompiler,
266    eSymbolTypeInstrumentation,
267    eSymbolTypeUndefined
268} SymbolType;
269
270
271//----------------------------------------------------------------------
272// Command Return Status Types
273//----------------------------------------------------------------------
274typedef enum ReturnStatus
275{
276    eReturnStatusInvalid,
277    eReturnStatusSuccessFinishNoResult,
278    eReturnStatusSuccessFinishResult,
279    eReturnStatusSuccessContinuingNoResult,
280    eReturnStatusSuccessContinuingResult,
281    eReturnStatusStarted,
282    eReturnStatusFailed,
283    eReturnStatusQuit
284} ReturnStatus;
285
286
287//----------------------------------------------------------------------
288// Connection Status Types
289//----------------------------------------------------------------------
290typedef enum ConnectionStatus
291{
292    eConnectionStatusSuccess,         // Success
293    eConnectionStatusError,           // Check GetError() for details
294    eConnectionStatusTimedOut,        // Request timed out
295    eConnectionStatusNoConnection,    // No connection
296    eConnectionStatusLostConnection   // Lost connection while connected to a valid connection
297} ConnectionStatus;
298
299
300typedef enum ErrorType
301{
302    eErrorTypeInvalid,
303    eErrorTypeGeneric,      ///< Generic errors that can be any value.
304    eErrorTypeMachKernel,   ///< Mach kernel error codes.
305    eErrorTypePOSIX         ///< POSIX error codes.
306} ErrorType;
307
308
309typedef enum ValueType
310{
311    eValueTypeInvalid           = 0,
312    eValueTypeVariableGlobal    = 1,    // globals variable
313    eValueTypeVariableStatic    = 2,    // static variable
314    eValueTypeVariableArgument  = 3,    // function argument variables
315    eValueTypeVariableLocal     = 4,    // function local variables
316    eValueTypeRegister          = 5,    // stack frame register value
317    eValueTypeRegisterSet       = 6     // A collection of stack frame register values
318} ValueType;
319
320//----------------------------------------------------------------------
321// Token size/granularities for Input Readers
322//----------------------------------------------------------------------
323
324typedef enum InputReaderGranularity
325{
326    eInputReaderGranularityInvalid = 0,
327    eInputReaderGranularityByte,
328    eInputReaderGranularityWord,
329    eInputReaderGranularityLine,
330    eInputReaderGranularityAll
331} InputReaderGranularity;
332
333//------------------------------------------------------------------
334/// These mask bits allow a common interface for queries that can
335/// limit the amount of information that gets parsed to only the
336/// information that is requested. These bits also can indicate what
337/// actually did get resolved during query function calls.
338///
339/// Each definition corresponds to a one of the member variables
340/// in this class, and requests that that item be resolved, or
341/// indicates that the member did get resolved.
342//------------------------------------------------------------------
343typedef enum SymbolContextItem
344{
345    eSymbolContextTarget     = (1 << 0), ///< Set when \a target is requested from a query, or was located in query results
346    eSymbolContextModule     = (1 << 1), ///< Set when \a module is requested from a query, or was located in query results
347    eSymbolContextCompUnit   = (1 << 2), ///< Set when \a comp_unit is requested from a query, or was located in query results
348    eSymbolContextFunction   = (1 << 3), ///< Set when \a function is requested from a query, or was located in query results
349    eSymbolContextBlock      = (1 << 4), ///< Set when the deepest \a block is requested from a query, or was located in query results
350    eSymbolContextLineEntry  = (1 << 5), ///< Set when \a line_entry is requested from a query, or was located in query results
351    eSymbolContextSymbol     = (1 << 6), ///< Set when \a symbol is requested from a query, or was located in query results
352    eSymbolContextEverything = ((eSymbolContextSymbol << 1) - 1)  ///< Indicates to try and lookup everything up during a query.
353} SymbolContextItem;
354
355typedef enum Permissions
356{
357    ePermissionsWritable = (1 << 0),
358    ePermissionsReadable = (1 << 1),
359    ePermissionsExecutable = (1 << 2)
360} Permissions;
361
362typedef enum SectionType
363{
364    eSectionTypeInvalid,
365    eSectionTypeCode,
366    eSectionTypeContainer,              // The section contains child sections
367    eSectionTypeData,
368    eSectionTypeDataCString,            // Inlined C string data
369    eSectionTypeDataCStringPointers,    // Pointers to C string data
370    eSectionTypeDataSymbolAddress,      // Address of a symbol in the symbol table
371    eSectionTypeData4,
372    eSectionTypeData8,
373    eSectionTypeData16,
374    eSectionTypeDataPointers,
375    eSectionTypeDebug,
376    eSectionTypeZeroFill,
377    eSectionTypeDataObjCMessageRefs,    // Pointer to function pointer + selector
378    eSectionTypeDataObjCCFStrings,      // Objective C const CFString/NSString objects
379    eSectionTypeDWARFDebugAbbrev,
380    eSectionTypeDWARFDebugAranges,
381    eSectionTypeDWARFDebugFrame,
382    eSectionTypeDWARFDebugInfo,
383    eSectionTypeDWARFDebugLine,
384    eSectionTypeDWARFDebugLoc,
385    eSectionTypeDWARFDebugMacInfo,
386    eSectionTypeDWARFDebugPubNames,
387    eSectionTypeDWARFDebugPubTypes,
388    eSectionTypeDWARFDebugRanges,
389    eSectionTypeDWARFDebugStr,
390    eSectionTypeEHFrame,
391    eSectionTypeOther
392
393} SectionType;
394
395
396typedef enum InputReaderAction
397{
398    eInputReaderActivate,   // reader is newly pushed onto the reader stack
399    eInputReaderReactivate, // reader is on top of the stack again after another reader was popped off
400    eInputReaderDeactivate, // another reader was pushed on the stack
401    eInputReaderGotToken,   // reader got one of its tokens (granularity)
402    eInputReaderDone        // reader was just popped off the stack and is done
403} InputReaderAction;
404
405
406typedef enum ArchitectureType
407{
408    eArchTypeInvalid,
409    eArchTypeMachO,
410    eArchTypeELF,
411    kNumArchTypes
412} ArchitectureType;
413
414typedef enum FunctionNameType
415{
416    eFunctionNameTypeNone       = 0u,
417    eFunctionNameTypeFull       = (1u << 1),// The function name.
418                                            // For C this is the same as just the name of the function
419                                            // For C++ this is the demangled version of the mangled name.
420                                            // For ObjC this is the full function signature with the + or
421                                            // - and the square brackets and the class and selector
422    eFunctionNameTypeBase       = (1u << 2),// The function name only, no namespaces or arguments and no class
423                                            // methods or selectors will be searched.
424    eFunctionNameTypeMethod     = (1u << 3),// Find function by method name (C++) with no namespace or arguments
425    eFunctionNameTypeSelector   = (1u << 4) // Find function by selector name (ObjC) names
426} FunctionNameType;
427
428
429typedef enum BreakpointEventType
430{
431    eBreakpointEventTypeInvalidType         = (1u << 0),
432    eBreakpointEventTypeAdded               = (1u << 1),
433    eBreakpointEventTypeRemoved             = (1u << 2),
434    eBreakpointEventTypeLocationsAdded      = (1u << 3),
435    eBreakpointEventTypeLocationsRemoved    = (1u << 4),
436    eBreakpointEventTypeLocationsResolved   = (1u << 5)
437} BreakpointEventType;
438
439
440//----------------------------------------------------------------------
441/// Programming language type.
442///
443/// These enumerations use the same language enumerations as the DWARF
444/// specification for ease of use and consistency.
445//----------------------------------------------------------------------
446typedef enum LanguageType
447{
448    eLanguageTypeUnknown         = 0x0000,   ///< Unknown or invalid language value.
449    eLanguageTypeC89             = 0x0001,   ///< ISO C:1989.
450    eLanguageTypeC               = 0x0002,   ///< Non-standardized C, such as K&R.
451    eLanguageTypeAda83           = 0x0003,   ///< ISO Ada:1983.
452    eLanguageTypeC_plus_plus     = 0x0004,   ///< ISO C++:1998.
453    eLanguageTypeCobol74         = 0x0005,   ///< ISO Cobol:1974.
454    eLanguageTypeCobol85         = 0x0006,   ///< ISO Cobol:1985.
455    eLanguageTypeFortran77       = 0x0007,   ///< ISO Fortran 77.
456    eLanguageTypeFortran90       = 0x0008,   ///< ISO Fortran 90.
457    eLanguageTypePascal83        = 0x0009,   ///< ISO Pascal:1983.
458    eLanguageTypeModula2         = 0x000a,   ///< ISO Modula-2:1996.
459    eLanguageTypeJava            = 0x000b,   ///< Java.
460    eLanguageTypeC99             = 0x000c,   ///< ISO C:1999.
461    eLanguageTypeAda95           = 0x000d,   ///< ISO Ada:1995.
462    eLanguageTypeFortran95       = 0x000e,   ///< ISO Fortran 95.
463    eLanguageTypePLI             = 0x000f,   ///< ANSI PL/I:1976.
464    eLanguageTypeObjC            = 0x0010,   ///< Objective-C.
465    eLanguageTypeObjC_plus_plus  = 0x0011,   ///< Objective-C++.
466    eLanguageTypeUPC             = 0x0012,   ///< Unified Parallel C.
467    eLanguageTypeD               = 0x0013,   ///< D.
468    eLanguageTypePython          = 0x0014    ///< Python.
469} LanguageType;
470
471
472typedef enum AccessType
473{
474    eAccessNone,
475    eAccessPublic,
476    eAccessPrivate,
477    eAccessProtected,
478    eAccessPackage
479} AccessType;
480
481//----------------------------------------------------------------------
482/// Settable state variable types.
483///
484//----------------------------------------------------------------------
485
486typedef enum SettableVariableType
487{
488    eSetVarTypeInt,
489    eSetVarTypeBool,
490    eSetVarTypeString,
491    eSetVarTypeArray,
492    eSetVarTypeDictionary,
493    eSetVarTypeEnum,
494    eSetVarTypeNone
495} SettableVariableType;
496
497typedef enum VarSetOperationType
498{
499    eVarSetOperationReplace,
500    eVarSetOperationInsertBefore,
501    eVarSetOperationInsertAfter,
502    eVarSetOperationRemove,
503    eVarSetOperationAppend,
504    eVarSetOperationClear,
505    eVarSetOperationAssign,
506    eVarSetOperationInvalid
507} VarSetOperationType;
508
509} // namespace lldb
510
511
512#endif  // LLDB_enumerations_h_
513