lldb-enumerations.h revision 48fbdf7ffd3c5e28e7b954ed92345c1c45256109
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    eValueTypeConstResult       = 7,    // function local variables
316} ValueType;
317
318//----------------------------------------------------------------------
319// Token size/granularities for Input Readers
320//----------------------------------------------------------------------
321
322typedef enum InputReaderGranularity
323{
324    eInputReaderGranularityInvalid = 0,
325    eInputReaderGranularityByte,
326    eInputReaderGranularityWord,
327    eInputReaderGranularityLine,
328    eInputReaderGranularityAll
329} InputReaderGranularity;
330
331//------------------------------------------------------------------
332/// These mask bits allow a common interface for queries that can
333/// limit the amount of information that gets parsed to only the
334/// information that is requested. These bits also can indicate what
335/// actually did get resolved during query function calls.
336///
337/// Each definition corresponds to a one of the member variables
338/// in this class, and requests that that item be resolved, or
339/// indicates that the member did get resolved.
340//------------------------------------------------------------------
341typedef enum SymbolContextItem
342{
343    eSymbolContextTarget     = (1 << 0), ///< Set when \a target is requested from a query, or was located in query results
344    eSymbolContextModule     = (1 << 1), ///< Set when \a module is requested from a query, or was located in query results
345    eSymbolContextCompUnit   = (1 << 2), ///< Set when \a comp_unit is requested from a query, or was located in query results
346    eSymbolContextFunction   = (1 << 3), ///< Set when \a function is requested from a query, or was located in query results
347    eSymbolContextBlock      = (1 << 4), ///< Set when the deepest \a block is requested from a query, or was located in query results
348    eSymbolContextLineEntry  = (1 << 5), ///< Set when \a line_entry is requested from a query, or was located in query results
349    eSymbolContextSymbol     = (1 << 6), ///< Set when \a symbol is requested from a query, or was located in query results
350    eSymbolContextEverything = ((eSymbolContextSymbol << 1) - 1)  ///< Indicates to try and lookup everything up during a query.
351} SymbolContextItem;
352
353typedef enum Permissions
354{
355    ePermissionsWritable = (1 << 0),
356    ePermissionsReadable = (1 << 1),
357    ePermissionsExecutable = (1 << 2)
358} Permissions;
359
360typedef enum SectionType
361{
362    eSectionTypeInvalid,
363    eSectionTypeCode,
364    eSectionTypeContainer,              // The section contains child sections
365    eSectionTypeData,
366    eSectionTypeDataCString,            // Inlined C string data
367    eSectionTypeDataCStringPointers,    // Pointers to C string data
368    eSectionTypeDataSymbolAddress,      // Address of a symbol in the symbol table
369    eSectionTypeData4,
370    eSectionTypeData8,
371    eSectionTypeData16,
372    eSectionTypeDataPointers,
373    eSectionTypeDebug,
374    eSectionTypeZeroFill,
375    eSectionTypeDataObjCMessageRefs,    // Pointer to function pointer + selector
376    eSectionTypeDataObjCCFStrings,      // Objective C const CFString/NSString objects
377    eSectionTypeDWARFDebugAbbrev,
378    eSectionTypeDWARFDebugAranges,
379    eSectionTypeDWARFDebugFrame,
380    eSectionTypeDWARFDebugInfo,
381    eSectionTypeDWARFDebugLine,
382    eSectionTypeDWARFDebugLoc,
383    eSectionTypeDWARFDebugMacInfo,
384    eSectionTypeDWARFDebugPubNames,
385    eSectionTypeDWARFDebugPubTypes,
386    eSectionTypeDWARFDebugRanges,
387    eSectionTypeDWARFDebugStr,
388    eSectionTypeEHFrame,
389    eSectionTypeOther
390
391} SectionType;
392
393
394typedef enum InputReaderAction
395{
396    eInputReaderActivate,   // reader is newly pushed onto the reader stack
397    eInputReaderReactivate, // reader is on top of the stack again after another reader was popped off
398    eInputReaderDeactivate, // another reader was pushed on the stack
399    eInputReaderGotToken,   // reader got one of its tokens (granularity)
400    eInputReaderDone        // reader was just popped off the stack and is done
401} InputReaderAction;
402
403
404typedef enum ArchitectureType
405{
406    eArchTypeInvalid,
407    eArchTypeMachO,
408    eArchTypeELF,
409    kNumArchTypes
410} ArchitectureType;
411
412typedef enum FunctionNameType
413{
414    eFunctionNameTypeNone       = 0u,
415    eFunctionNameTypeAuto       = (1u << 1),    // Automatically figure out which FunctionNameType
416                                                // bits to set based on the function name.
417    eFunctionNameTypeFull       = (1u << 2),    // 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 << 3),    // The function name only, no namespaces or arguments and no class
423                                                // methods or selectors will be searched.
424    eFunctionNameTypeMethod     = (1u << 4),    // Find function by method name (C++) with no namespace or arguments
425    eFunctionNameTypeSelector   = (1u << 5),    // 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//----------------------------------------------------------------------
510/// Command argument types.
511///
512//----------------------------------------------------------------------
513
514typedef enum CommandArgumentType
515{
516    eArgTypeAddress = 0,
517    eArgTypeAliasName,
518    eArgTypeAliasOptions,
519    eArgTypeArchitecture,
520    eArgTypeBoolean,
521    eArgTypeBreakpointID,
522    eArgTypeBreakpointIDRange,
523    eArgTypeByteSize,
524    eArgTypeCommandName,
525    eArgTypeCount,
526    eArgTypeEndAddress,
527    eArgTypeExpression,
528    eArgTypeExprFormat,
529    eArgTypeFilename,
530    eArgTypeFormat,
531    eArgTypeFrameIndex,
532    eArgTypeFullName,
533    eArgTypeFunctionName,
534    eArgTypeIndex,
535    eArgTypeLineNum,
536    eArgTypeLogChannel,
537    eArgTypeMethod,
538    eArgTypeName,
539    eArgTypeNewPathPrefix,
540    eArgTypeNumLines,
541    eArgTypeNumberPerLine,
542    eArgTypeOffset,
543    eArgTypeOldPathPrefix,
544    eArgTypeOneLiner,
545    eArgTypePath,
546    eArgTypePid,
547    eArgTypePlugin,
548    eArgTypeProcessName,
549    eArgTypeQueueName,
550    eArgTypeRegisterName,
551    eArgTypeRegularExpression,
552    eArgTypeRunArgs,
553    eArgTypeRunMode,
554    eArgTypeScriptLang,
555    eArgTypeSearchWord,
556    eArgTypeSelector,
557    eArgTypeSettingIndex,
558    eArgTypeSettingKey,
559    eArgTypeSettingPrefix,
560    eArgTypeSettingVariableName,
561    eArgTypeShlibName,
562    eArgTypeSourceFile,
563    eArgTypeSortOrder,
564    eArgTypeStartAddress,
565    eArgTypeSymbol,
566    eArgTypeThreadID,
567    eArgTypeThreadIndex,
568    eArgTypeThreadName,
569    eArgTypeUnixSignalNumber,
570    eArgTypeVarName,
571    eArgTypeValue,
572    eArgTypeWidth,
573    eArgTypeNone,
574    eArgTypeLastArg  // Always keep this entry as the last entry in this enumeration!!
575} CommandArgumentType;
576
577typedef enum ArgumentRepetitionType
578{
579    eArgRepeatPlain,            // Exactly one occurrence
580    eArgRepeatOptional,         // At most one occurrence, but it's optional
581    eArgRepeatPlus,             // One or more occurrences
582    eArgRepeatStar,             // Zero or more occurrences
583    eArgRepeatRange,            // Repetition of same argument, from 1 to n
584    eArgRepeatPairPlain,        // A pair of arguments that must always go together ([arg-type arg-value]), occurs exactly once
585    eArgRepeatPairOptional,     // A pair that occurs at most once (optional)
586    eArgRepeatPairPlus,         // One or more occurrences of a pair
587    eArgRepeatPairStar,         // Zero or more occurrences of a pair
588    eArgRepeatPairRange,        // A pair that repeats from 1 to n
589    eArgRepeatPairRangeOptional // A pair that repeats from 1 to n, but is optional
590} ArgumentRepetitionType;
591
592typedef enum SortOrder
593{
594    eSortOrderNone,
595    eSortOrderByAddress,
596    eSortOrderByName,
597} SortOrder;
598
599} // namespace lldb
600
601
602#endif  // LLDB_enumerations_h_
603