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