lldb-enumerations.h revision 4d6675c8e1cab6360f59865229835ae137d6f68a
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,    // 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 particular target
204    eRegisterKindGDB,        // the register numbers gdb uses (matches stabs numbers?)
205    eRegisterKindLLDB,       // lldb's internal register numbers
206    kNumRegisterKinds
207} RegisterKind;
208
209//----------------------------------------------------------------------
210// Thread stop reasons
211//----------------------------------------------------------------------
212typedef enum StopReason
213{
214    eStopReasonInvalid = 0,
215    eStopReasonNone,
216    eStopReasonTrace,
217    eStopReasonBreakpoint,
218    eStopReasonWatchpoint,
219    eStopReasonSignal,
220    eStopReasonException,
221    eStopReasonPlanComplete
222} StopReason;
223
224//----------------------------------------------------------------------
225// Votes - Need a tri-state, yes, no, no opinion...
226//----------------------------------------------------------------------
227typedef enum Vote
228{
229    eVoteNo         = -1,
230    eVoteNoOpinion  =  0,
231    eVoteYes        =  1
232} Vote;
233
234//----------------------------------------------------------------------
235// Symbol types
236//----------------------------------------------------------------------
237typedef enum SymbolType
238{
239    eSymbolTypeAny = 0,
240    eSymbolTypeInvalid = 0,
241    eSymbolTypeAbsolute,
242    eSymbolTypeExtern,
243    eSymbolTypeCode,
244    eSymbolTypeData,
245    eSymbolTypeTrampoline,
246    eSymbolTypeRuntime,
247    eSymbolTypeException,
248    eSymbolTypeSourceFile,
249    eSymbolTypeHeaderFile,
250    eSymbolTypeObjectFile,
251    eSymbolTypeCommonBlock,
252    eSymbolTypeBlock,
253    eSymbolTypeLocal,
254    eSymbolTypeParam,
255    eSymbolTypeVariable,
256    eSymbolTypeVariableType,
257    eSymbolTypeLineEntry,
258    eSymbolTypeLineHeader,
259    eSymbolTypeScopeBegin,
260    eSymbolTypeScopeEnd,
261    eSymbolTypeAdditional, // When symbols take more than one entry, the extra entries get this type
262    eSymbolTypeCompiler,
263    eSymbolTypeInstrumentation,
264    eSymbolTypeUndefined
265} SymbolType;
266
267
268//----------------------------------------------------------------------
269// Command Return Status Types
270//----------------------------------------------------------------------
271typedef enum ReturnStatus
272{
273    eReturnStatusInvalid,
274    eReturnStatusSuccessFinishNoResult,
275    eReturnStatusSuccessFinishResult,
276    eReturnStatusSuccessContinuingNoResult,
277    eReturnStatusSuccessContinuingResult,
278    eReturnStatusStarted,
279    eReturnStatusFailed,
280    eReturnStatusQuit
281} ReturnStatus;
282
283
284//----------------------------------------------------------------------
285// Connection Status Types
286//----------------------------------------------------------------------
287typedef enum ConnectionStatus
288{
289    eConnectionStatusSuccess,         // Success
290    eConnectionStatusError,           // Check GetError() for details
291    eConnectionStatusTimedOut,        // Request timed out
292    eConnectionStatusNoConnection,    // No connection
293    eConnectionStatusLostConnection   // Lost connection while connected to a valid connection
294} ConnectionStatus;
295
296
297typedef enum ErrorType
298{
299    eErrorTypeInvalid,
300    eErrorTypeGeneric,      ///< Generic errors that can be any value.
301    eErrorTypeMachKernel,   ///< Mach kernel error codes.
302    eErrorTypePOSIX         ///< POSIX error codes.
303} ErrorType;
304
305
306typedef enum ValueType
307{
308    eValueTypeInvalid           = 0,
309    eValueTypeVariableGlobal    = 1,    // globals variable
310    eValueTypeVariableStatic    = 2,    // static variable
311    eValueTypeVariableArgument  = 3,    // function argument variables
312    eValueTypeVariableLocal     = 4,    // function local variables
313    eValueTypeRegister          = 5,    // stack frame register value
314    eValueTypeRegisterSet       = 6     // A collection of stack frame register values
315} ValueType;
316
317//----------------------------------------------------------------------
318// Token size/granularities for Input Readers
319//----------------------------------------------------------------------
320
321typedef enum InputReaderGranularity
322{
323    eInputReaderGranularityInvalid = 0,
324    eInputReaderGranularityByte,
325    eInputReaderGranularityWord,
326    eInputReaderGranularityLine,
327    eInputReaderGranularityAll
328} InputReaderGranularity;
329
330//------------------------------------------------------------------
331/// These mask bits allow a common interface for queries that can
332/// limit the amount of information that gets parsed to only the
333/// information that is requested. These bits also can indicate what
334/// actually did get resolved during query function calls.
335///
336/// Each definition corresponds to a one of the member variables
337/// in this class, and requests that that item be resolved, or
338/// indicates that the member did get resolved.
339//------------------------------------------------------------------
340typedef enum SymbolContextItem
341{
342    eSymbolContextTarget     = (1 << 0), ///< Set when \a target is requested from a query, or was located in query results
343    eSymbolContextModule     = (1 << 1), ///< Set when \a module is requested from a query, or was located in query results
344    eSymbolContextCompUnit   = (1 << 2), ///< Set when \a comp_unit is requested from a query, or was located in query results
345    eSymbolContextFunction   = (1 << 3), ///< Set when \a function is requested from a query, or was located in query results
346    eSymbolContextBlock      = (1 << 4), ///< Set when the deepest \a block is requested from a query, or was located in query results
347    eSymbolContextLineEntry  = (1 << 5), ///< Set when \a line_entry is requested from a query, or was located in query results
348    eSymbolContextSymbol     = (1 << 6), ///< Set when \a symbol is requested from a query, or was located in query results
349    eSymbolContextEverything = ((eSymbolContextSymbol << 1) - 1)  ///< Indicates to try and lookup everything up during a query.
350} SymbolContextItem;
351
352typedef enum Permissions
353{
354    ePermissionsWritable = (1 << 0),
355    ePermissionsReadable = (1 << 1),
356    ePermissionsExecutable = (1 << 2)
357} Permissions;
358
359typedef enum SectionType
360{
361    eSectionTypeInvalid,
362    eSectionTypeCode,
363    eSectionTypeContainer,              // The section contains child sections
364    eSectionTypeData,
365    eSectionTypeDataCString,            // Inlined C string data
366    eSectionTypeDataCStringPointers,    // Pointers to C string data
367    eSectionTypeDataSymbolAddress,      // Address of a symbol in the symbol table
368    eSectionTypeData4,
369    eSectionTypeData8,
370    eSectionTypeData16,
371    eSectionTypeDataPointers,
372    eSectionTypeDebug,
373    eSectionTypeZeroFill,
374    eSectionTypeDataObjCMessageRefs,    // Pointer to function pointer + selector
375    eSectionTypeDataObjCCFStrings,      // Objective C const CFString/NSString objects
376    eSectionTypeDWARFDebugAbbrev,
377    eSectionTypeDWARFDebugAranges,
378    eSectionTypeDWARFDebugFrame,
379    eSectionTypeDWARFDebugInfo,
380    eSectionTypeDWARFDebugLine,
381    eSectionTypeDWARFDebugLoc,
382    eSectionTypeDWARFDebugMacInfo,
383    eSectionTypeDWARFDebugPubNames,
384    eSectionTypeDWARFDebugPubTypes,
385    eSectionTypeDWARFDebugRanges,
386    eSectionTypeDWARFDebugStr,
387    eSectionTypeEHFrame,
388    eSectionTypeOther
389
390} SectionType;
391
392
393typedef enum InputReaderAction
394{
395    eInputReaderActivate,   // reader is newly pushed onto the reader stack
396    eInputReaderReactivate, // reader is on top of the stack again after another reader was popped off
397    eInputReaderDeactivate, // another reader was pushed on the stack
398    eInputReaderGotToken,   // reader got one of its tokens (granularity)
399    eInputReaderDone        // reader was just popped off the stack and is done
400} InputReaderAction;
401
402
403typedef enum ArchitectureType
404{
405    eArchTypeInvalid,
406    eArchTypeMachO,
407    eArchTypeELF,
408    kNumArchTypes
409} ArchitectureType;
410
411typedef enum FunctionNameType
412{
413    eFunctionNameTypeNone       = 0u,
414    eFunctionNameTypeFull       = (1u << 1),// The function name.
415                                            // For C this is the same as just the name of the function
416                                            // For C++ this is the demangled version of the mangled name.
417                                            // For ObjC this is the full function signature with the + or
418                                            // - and the square brackets and the class and selector
419    eFunctionNameTypeBase       = (1u << 2),// The function name only, no namespaces or arguments and no class
420                                            // methods or selectors will be searched.
421    eFunctionNameTypeMethod     = (1u << 3),// Find function by method name (C++) with no namespace or arguments
422    eFunctionNameTypeSelector   = (1u << 4) // Find function by selector name (ObjC) names
423} FunctionNameType;
424
425
426typedef enum BreakpointEventType
427{
428    eBreakpointEventTypeInvalidType         = (1u << 0),
429    eBreakpointEventTypeAdded               = (1u << 1),
430    eBreakpointEventTypeRemoved             = (1u << 2),
431    eBreakpointEventTypeLocationsAdded      = (1u << 3),
432    eBreakpointEventTypeLocationsRemoved    = (1u << 4),
433    eBreakpointEventTypeLocationsResolved   = (1u << 5)
434} BreakpointEventType;
435
436
437//----------------------------------------------------------------------
438/// Programming language type.
439///
440/// These enumerations use the same language enumerations as the DWARF
441/// specification for ease of use and consistency.
442//----------------------------------------------------------------------
443typedef enum LanguageType
444{
445    eLanguageTypeUnknown         = 0x0000,   ///< Unknown or invalid language value.
446    eLanguageTypeC89             = 0x0001,   ///< ISO C:1989.
447    eLanguageTypeC               = 0x0002,   ///< Non-standardized C, such as K&R.
448    eLanguageTypeAda83           = 0x0003,   ///< ISO Ada:1983.
449    eLanguageTypeC_plus_plus     = 0x0004,   ///< ISO C++:1998.
450    eLanguageTypeCobol74         = 0x0005,   ///< ISO Cobol:1974.
451    eLanguageTypeCobol85         = 0x0006,   ///< ISO Cobol:1985.
452    eLanguageTypeFortran77       = 0x0007,   ///< ISO Fortran 77.
453    eLanguageTypeFortran90       = 0x0008,   ///< ISO Fortran 90.
454    eLanguageTypePascal83        = 0x0009,   ///< ISO Pascal:1983.
455    eLanguageTypeModula2         = 0x000a,   ///< ISO Modula-2:1996.
456    eLanguageTypeJava            = 0x000b,   ///< Java.
457    eLanguageTypeC99             = 0x000c,   ///< ISO C:1999.
458    eLanguageTypeAda95           = 0x000d,   ///< ISO Ada:1995.
459    eLanguageTypeFortran95       = 0x000e,   ///< ISO Fortran 95.
460    eLanguageTypePLI             = 0x000f,   ///< ANSI PL/I:1976.
461    eLanguageTypeObjC            = 0x0010,   ///< Objective-C.
462    eLanguageTypeObjC_plus_plus  = 0x0011,   ///< Objective-C++.
463    eLanguageTypeUPC             = 0x0012,   ///< Unified Parallel C.
464    eLanguageTypeD               = 0x0013,   ///< D.
465    eLanguageTypePython          = 0x0014    ///< Python.
466} LanguageType;
467
468
469typedef enum AccessType
470{
471    eAccessNone,
472    eAccessPublic,
473    eAccessPrivate,
474    eAccessProtected,
475    eAccessPackage
476} AccessType;
477
478//----------------------------------------------------------------------
479/// Settable state variable types.
480///
481//----------------------------------------------------------------------
482
483typedef enum SettableVariableType
484{
485    eSetVarTypeInt,
486    eSetVarTypeBool,
487    eSetVarTypeString,
488    eSetVarTypeArray,
489    eSetVarTypeDictionary,
490    eSetVarTypeEnum,
491    eSetVarTypeNone
492} SettableVariableType;
493
494typedef enum VarSetOperationType
495{
496    eVarSetOperationReplace,
497    eVarSetOperationInsertBefore,
498    eVarSetOperationInsertAfter,
499    eVarSetOperationRemove,
500    eVarSetOperationAppend,
501    eVarSetOperationClear,
502    eVarSetOperationAssign,
503    eVarSetOperationInvalid
504} VarSetOperationType;
505
506//----------------------------------------------------------------------
507/// Command argument types.
508///
509//----------------------------------------------------------------------
510
511typedef enum CommandArgumentType
512{
513    eArgTypeAddress = 0,
514    eArgTypeArchitecture,
515    eArgTypeBoolean,
516    eArgTypeBreakpointID,
517    eArgTypeBreakpointIDRange,
518    eArgTypeByteSize,
519    eArgTypeChannel,
520    eArgTypeCount,
521    eArgTypeExpression,
522    eArgTypeExprFormat,
523    eArgTypeFilename,
524    eArgTypeFormat,
525    eArgTypeFrameNum,
526    eArgTypeFullName,
527    eArgTypeFunctionName,
528    eArgTypeIndex,
529    eArgTypeLineNum,
530    eArgTypeMethod,
531    eArgTypeName,
532    eArgTypeNumLines,
533    eArgTypeNumberPerLine,
534    eArgTypeOffset,
535    eArgTypeOneLiner,
536    eArgTypeOther,
537    eArgTypePath,
538    eArgTypePathPrefix,
539    eArgTypePathPrefixPair,
540    eArgTypePid,
541    eArgTypePlugin,
542    eArgTypeProcessName,
543    eArgTypeQueueName,
544    eArgTypeRegisterName,
545    eArgTypeRegularExpression,
546    eArgTypeRunMode,
547    eArgTypeScriptLang,
548    eArgTypeSearchWord,
549    eArgTypeSelector,
550    eArgTypeSettingIndex,
551    eArgTypeSettingKey,
552    eArgTypeSettingPrefix,
553    eArgTypeSettingVariableName,
554    eArgTypeShlibName,
555    eArgTypeSourceFile,
556    eArgTypeStartAddress,
557    eArgTypeSymbol,
558    eArgTypeThreadID,
559    eArgTypeThreadIndex,
560    eArgTypeThreadName,
561    eArgTypeUUID,
562    eArgTypeUnixSignalNumber,
563    eArgTypeVarName,
564    eArgTypeValue,
565    eArgTypeWidth,
566    eArgTypeNone,
567    eArgTypeLastArg  // Always keep this entry as the last entry in this enumeration!!
568} CommandArgumentType;
569
570typedef enum ArgumentRepetitionType
571{
572    eArgRepeatPlain,    // Exactly one occurrence
573    eArgRepeatOptional, // At most one occurrence, but it's optional
574    eArgRepeatPlus,     // One or more occurrences
575    eArgRepeatStar      // Zero or more occurrences
576} ArgumentRepetitionType;
577
578
579} // namespace lldb
580
581
582#endif  // LLDB_enumerations_h_
583