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