lldb-enumerations.h revision 888a7334344778d1a4edbd58b5852ae4d53ffed9
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_lldb_enumerations_h_
11#define LLDB_lldb_enumerations_h_
12
13namespace lldb {
14
15    //----------------------------------------------------------------------
16    // Process and Thread States
17    //----------------------------------------------------------------------
18    typedef 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    // Launch Flags
38    //----------------------------------------------------------------------
39    typedef enum LaunchFlags
40    {
41        eLaunchFlagNone         = 0u,
42        eLaunchFlagExec         = (1u << 0),  ///< Exec when launching and turn the calling process into a new process
43        eLaunchFlagDebug        = (1u << 1),  ///< Stop as soon as the process launches to allow the process to be debugged
44        eLaunchFlagStopAtEntry  = (1u << 2),  ///< Stop at the program entry point instead of auto-continuing when launching or attaching at entry point
45        eLaunchFlagDisableASLR  = (1u << 3),  ///< Disable Address Space Layout Randomization
46        eLaunchFlagDisableSTDIO = (1u << 4),  ///< Disable stdio for inferior process (e.g. for a GUI app)
47        eLaunchFlagLaunchInTTY  = (1u << 5)   ///< Launch the process in a new TTY if supported by the host
48    } LaunchFlags;
49
50    //----------------------------------------------------------------------
51    // Thread Run Modes
52    //----------------------------------------------------------------------
53    typedef enum RunMode {
54        eOnlyThisThread,
55        eAllThreads,
56        eOnlyDuringStepping
57    } RunMode;
58
59    //----------------------------------------------------------------------
60    // Byte ordering definitions
61    //----------------------------------------------------------------------
62    typedef enum ByteOrder
63    {
64        eByteOrderInvalid   = 0,
65        eByteOrderBig       = 1,
66        eByteOrderPDP       = 2,
67        eByteOrderLittle    = 4
68    } ByteOrder;
69
70    //----------------------------------------------------------------------
71    // Register encoding definitions
72    //----------------------------------------------------------------------
73    typedef enum Encoding
74    {
75        eEncodingInvalid = 0,
76        eEncodingUint,               // unsigned integer
77        eEncodingSint,               // signed integer
78        eEncodingIEEE754,            // float
79        eEncodingVector              // vector registers
80    } Encoding;
81
82    //----------------------------------------------------------------------
83    // Display format definitions
84    //----------------------------------------------------------------------
85    typedef enum Format
86    {
87        eFormatDefault = 0,
88        eFormatInvalid = 0,
89        eFormatBoolean,
90        eFormatBinary,
91        eFormatBytes,
92        eFormatBytesWithASCII,
93        eFormatChar,
94        eFormatCharPrintable,   // Only printable characters, space if not printable
95        eFormatComplex,         // Floating point complex type
96        eFormatComplexFloat = eFormatComplex,
97        eFormatCString,         // NULL terminated C strings
98        eFormatDecimal,
99        eFormatEnum,
100        eFormatHex,
101        eFormatFloat,
102        eFormatOctal,
103        eFormatOSType,          // OS character codes encoded into an integer 'PICT' 'text' etc...
104        eFormatUnicode16,
105        eFormatUnicode32,
106        eFormatUnsigned,
107        eFormatPointer,
108        eFormatVectorOfChar,
109        eFormatVectorOfSInt8,
110        eFormatVectorOfUInt8,
111        eFormatVectorOfSInt16,
112        eFormatVectorOfUInt16,
113        eFormatVectorOfSInt32,
114        eFormatVectorOfUInt32,
115        eFormatVectorOfSInt64,
116        eFormatVectorOfUInt64,
117        eFormatVectorOfFloat32,
118        eFormatVectorOfFloat64,
119        eFormatVectorOfUInt128,
120        eFormatComplexInteger   // Integer complex type
121
122    } Format;
123
124    //----------------------------------------------------------------------
125    // Description levels for "void GetDescription(Stream *, DescriptionLevel)" calls
126    //----------------------------------------------------------------------
127    typedef enum DescriptionLevel
128    {
129        eDescriptionLevelBrief = 0,
130        eDescriptionLevelFull,
131        eDescriptionLevelVerbose,
132        kNumDescriptionLevels
133    } DescriptionLevel;
134
135    //----------------------------------------------------------------------
136    // Script interpreter types
137    //----------------------------------------------------------------------
138    typedef enum ScriptLanguage
139    {
140        eScriptLanguageNone,
141        eScriptLanguagePython,
142        eScriptLanguageDefault = eScriptLanguagePython
143    } ScriptLanguage;
144
145    //----------------------------------------------------------------------
146    // Register numbering types
147    //----------------------------------------------------------------------
148    typedef enum RegisterKind
149    {
150        eRegisterKindGCC = 0,    // the register numbers seen in eh_frame
151        eRegisterKindDWARF,      // the register numbers seen DWARF
152        eRegisterKindGeneric,    // insn ptr reg, stack ptr reg, etc not specific to any particular target
153        eRegisterKindGDB,        // the register numbers gdb uses (matches stabs numbers?)
154        eRegisterKindLLDB,       // lldb's internal register numbers
155        kNumRegisterKinds
156    } RegisterKind;
157
158    //----------------------------------------------------------------------
159    // Thread stop reasons
160    //----------------------------------------------------------------------
161    typedef enum StopReason
162    {
163        eStopReasonInvalid = 0,
164        eStopReasonNone,
165        eStopReasonTrace,
166        eStopReasonBreakpoint,
167        eStopReasonWatchpoint,
168        eStopReasonSignal,
169        eStopReasonException,
170        eStopReasonPlanComplete
171    } StopReason;
172
173    //----------------------------------------------------------------------
174    // Command Return Status Types
175    //----------------------------------------------------------------------
176    typedef enum ReturnStatus
177    {
178        eReturnStatusInvalid,
179        eReturnStatusSuccessFinishNoResult,
180        eReturnStatusSuccessFinishResult,
181        eReturnStatusSuccessContinuingNoResult,
182        eReturnStatusSuccessContinuingResult,
183        eReturnStatusStarted,
184        eReturnStatusFailed,
185        eReturnStatusQuit
186    } ReturnStatus;
187
188
189    //----------------------------------------------------------------------
190    // Connection Status Types
191    //----------------------------------------------------------------------
192    typedef enum ConnectionStatus
193    {
194        eConnectionStatusSuccess,         // Success
195        eConnectionStatusEndOfFile,       // End-of-file encountered
196        eConnectionStatusError,           // Check GetError() for details
197        eConnectionStatusTimedOut,        // Request timed out
198        eConnectionStatusNoConnection,    // No connection
199        eConnectionStatusLostConnection   // Lost connection while connected to a valid connection
200    } ConnectionStatus;
201
202    typedef enum ErrorType
203    {
204        eErrorTypeInvalid,
205        eErrorTypeGeneric,      ///< Generic errors that can be any value.
206        eErrorTypeMachKernel,   ///< Mach kernel error codes.
207        eErrorTypePOSIX         ///< POSIX error codes.
208    } ErrorType;
209
210
211    typedef enum ValueType
212    {
213        eValueTypeInvalid           = 0,
214        eValueTypeVariableGlobal    = 1,    // globals variable
215        eValueTypeVariableStatic    = 2,    // static variable
216        eValueTypeVariableArgument  = 3,    // function argument variables
217        eValueTypeVariableLocal     = 4,    // function local variables
218        eValueTypeRegister          = 5,    // stack frame register value
219        eValueTypeRegisterSet       = 6,    // A collection of stack frame register values
220        eValueTypeConstResult       = 7     // constant result variables
221    } ValueType;
222
223    //----------------------------------------------------------------------
224    // Token size/granularities for Input Readers
225    //----------------------------------------------------------------------
226
227    typedef enum InputReaderGranularity
228    {
229        eInputReaderGranularityInvalid = 0,
230        eInputReaderGranularityByte,
231        eInputReaderGranularityWord,
232        eInputReaderGranularityLine,
233        eInputReaderGranularityAll
234    } InputReaderGranularity;
235
236    //------------------------------------------------------------------
237    /// These mask bits allow a common interface for queries that can
238    /// limit the amount of information that gets parsed to only the
239    /// information that is requested. These bits also can indicate what
240    /// actually did get resolved during query function calls.
241    ///
242    /// Each definition corresponds to a one of the member variables
243    /// in this class, and requests that that item be resolved, or
244    /// indicates that the member did get resolved.
245    //------------------------------------------------------------------
246    typedef enum SymbolContextItem
247    {
248        eSymbolContextTarget     = (1 << 0), ///< Set when \a target is requested from a query, or was located in query results
249        eSymbolContextModule     = (1 << 1), ///< Set when \a module is requested from a query, or was located in query results
250        eSymbolContextCompUnit   = (1 << 2), ///< Set when \a comp_unit is requested from a query, or was located in query results
251        eSymbolContextFunction   = (1 << 3), ///< Set when \a function is requested from a query, or was located in query results
252        eSymbolContextBlock      = (1 << 4), ///< Set when the deepest \a block is requested from a query, or was located in query results
253        eSymbolContextLineEntry  = (1 << 5), ///< Set when \a line_entry is requested from a query, or was located in query results
254        eSymbolContextSymbol     = (1 << 6), ///< Set when \a symbol is requested from a query, or was located in query results
255        eSymbolContextEverything = ((eSymbolContextSymbol << 1) - 1)  ///< Indicates to try and lookup everything up during a query.
256    } SymbolContextItem;
257
258    typedef enum Permissions
259    {
260        ePermissionsWritable = (1 << 0),
261        ePermissionsReadable = (1 << 1),
262        ePermissionsExecutable = (1 << 2)
263    } Permissions;
264
265    typedef enum InputReaderAction
266    {
267        eInputReaderActivate,   // reader is newly pushed onto the reader stack
268        eInputReaderReactivate, // reader is on top of the stack again after another reader was popped off
269        eInputReaderDeactivate, // another reader was pushed on the stack
270        eInputReaderGotToken,   // reader got one of its tokens (granularity)
271        eInputReaderInterrupt,  // reader received an interrupt signal (probably from a control-c)
272        eInputReaderEndOfFile,  // reader received an EOF char (probably from a control-d)
273        eInputReaderDone        // reader was just popped off the stack and is done
274    } InputReaderAction;
275
276    typedef enum BreakpointEventType
277    {
278        eBreakpointEventTypeInvalidType         = (1u << 0),
279        eBreakpointEventTypeAdded               = (1u << 1),
280        eBreakpointEventTypeRemoved             = (1u << 2),
281        eBreakpointEventTypeLocationsAdded      = (1u << 3),
282        eBreakpointEventTypeLocationsRemoved    = (1u << 4),
283        eBreakpointEventTypeLocationsResolved   = (1u << 5)
284    } BreakpointEventType;
285
286
287    //----------------------------------------------------------------------
288    /// Programming language type.
289    ///
290    /// These enumerations use the same language enumerations as the DWARF
291    /// specification for ease of use and consistency.
292    //----------------------------------------------------------------------
293    typedef enum LanguageType
294    {
295        eLanguageTypeUnknown         = 0x0000,   ///< Unknown or invalid language value.
296        eLanguageTypeC89             = 0x0001,   ///< ISO C:1989.
297        eLanguageTypeC               = 0x0002,   ///< Non-standardized C, such as K&R.
298        eLanguageTypeAda83           = 0x0003,   ///< ISO Ada:1983.
299        eLanguageTypeC_plus_plus     = 0x0004,   ///< ISO C++:1998.
300        eLanguageTypeCobol74         = 0x0005,   ///< ISO Cobol:1974.
301        eLanguageTypeCobol85         = 0x0006,   ///< ISO Cobol:1985.
302        eLanguageTypeFortran77       = 0x0007,   ///< ISO Fortran 77.
303        eLanguageTypeFortran90       = 0x0008,   ///< ISO Fortran 90.
304        eLanguageTypePascal83        = 0x0009,   ///< ISO Pascal:1983.
305        eLanguageTypeModula2         = 0x000a,   ///< ISO Modula-2:1996.
306        eLanguageTypeJava            = 0x000b,   ///< Java.
307        eLanguageTypeC99             = 0x000c,   ///< ISO C:1999.
308        eLanguageTypeAda95           = 0x000d,   ///< ISO Ada:1995.
309        eLanguageTypeFortran95       = 0x000e,   ///< ISO Fortran 95.
310        eLanguageTypePLI             = 0x000f,   ///< ANSI PL/I:1976.
311        eLanguageTypeObjC            = 0x0010,   ///< Objective-C.
312        eLanguageTypeObjC_plus_plus  = 0x0011,   ///< Objective-C++.
313        eLanguageTypeUPC             = 0x0012,   ///< Unified Parallel C.
314        eLanguageTypeD               = 0x0013,   ///< D.
315        eLanguageTypePython          = 0x0014    ///< Python.
316    } LanguageType;
317
318
319    typedef enum AccessType
320    {
321        eAccessNone,
322        eAccessPublic,
323        eAccessPrivate,
324        eAccessProtected,
325        eAccessPackage
326    } AccessType;
327
328    typedef enum CommandArgumentType
329    {
330        eArgTypeAddress = 0,
331        eArgTypeAliasName,
332        eArgTypeAliasOptions,
333        eArgTypeArchitecture,
334        eArgTypeBoolean,
335        eArgTypeBreakpointID,
336        eArgTypeBreakpointIDRange,
337        eArgTypeByteSize,
338        eArgTypeClassName,
339        eArgTypeCommandName,
340        eArgTypeCount,
341        eArgTypeEndAddress,
342        eArgTypeExpression,
343        eArgTypeExprFormat,
344        eArgTypeFilename,
345        eArgTypeFormat,
346        eArgTypeFrameIndex,
347        eArgTypeFullName,
348        eArgTypeFunctionName,
349        eArgTypeIndex,
350        eArgTypeLineNum,
351        eArgTypeLogCategory,
352        eArgTypeLogChannel,
353        eArgTypeMethod,
354        eArgTypeName,
355        eArgTypeNewPathPrefix,
356        eArgTypeNumLines,
357        eArgTypeNumberPerLine,
358        eArgTypeOffset,
359        eArgTypeOldPathPrefix,
360        eArgTypeOneLiner,
361        eArgTypePath,
362        eArgTypePid,
363        eArgTypePlugin,
364        eArgTypeProcessName,
365        eArgTypeQueueName,
366        eArgTypeRegisterName,
367        eArgTypeRegularExpression,
368        eArgTypeRunArgs,
369        eArgTypeRunMode,
370        eArgTypeScriptLang,
371        eArgTypeSearchWord,
372        eArgTypeSelector,
373        eArgTypeSettingIndex,
374        eArgTypeSettingKey,
375        eArgTypeSettingPrefix,
376        eArgTypeSettingVariableName,
377        eArgTypeShlibName,
378        eArgTypeSourceFile,
379        eArgTypeSortOrder,
380        eArgTypeStartAddress,
381        eArgTypeSymbol,
382        eArgTypeThreadID,
383        eArgTypeThreadIndex,
384        eArgTypeThreadName,
385        eArgTypeUnixSignal,
386        eArgTypeVarName,
387        eArgTypeValue,
388        eArgTypeWidth,
389        eArgTypeNone,
390        eArgTypePlatform,
391        eArgTypeLastArg  // Always keep this entry as the last entry in this enumeration!!
392    } CommandArgumentType;
393
394    //----------------------------------------------------------------------
395    // Symbol types
396    //----------------------------------------------------------------------
397    typedef enum SymbolType
398    {
399        eSymbolTypeAny = 0,
400        eSymbolTypeInvalid = 0,
401        eSymbolTypeAbsolute,
402        eSymbolTypeExtern,
403        eSymbolTypeCode,
404        eSymbolTypeData,
405        eSymbolTypeTrampoline,
406        eSymbolTypeRuntime,
407        eSymbolTypeException,
408        eSymbolTypeSourceFile,
409        eSymbolTypeHeaderFile,
410        eSymbolTypeObjectFile,
411        eSymbolTypeCommonBlock,
412        eSymbolTypeBlock,
413        eSymbolTypeLocal,
414        eSymbolTypeParam,
415        eSymbolTypeVariable,
416        eSymbolTypeVariableType,
417        eSymbolTypeLineEntry,
418        eSymbolTypeLineHeader,
419        eSymbolTypeScopeBegin,
420        eSymbolTypeScopeEnd,
421        eSymbolTypeAdditional, // When symbols take more than one entry, the extra entries get this type
422        eSymbolTypeCompiler,
423        eSymbolTypeInstrumentation,
424        eSymbolTypeUndefined
425    } SymbolType;
426
427    typedef enum SectionType
428    {
429        eSectionTypeInvalid,
430        eSectionTypeCode,
431        eSectionTypeContainer,              // The section contains child sections
432        eSectionTypeData,
433        eSectionTypeDataCString,            // Inlined C string data
434        eSectionTypeDataCStringPointers,    // Pointers to C string data
435        eSectionTypeDataSymbolAddress,      // Address of a symbol in the symbol table
436        eSectionTypeData4,
437        eSectionTypeData8,
438        eSectionTypeData16,
439        eSectionTypeDataPointers,
440        eSectionTypeDebug,
441        eSectionTypeZeroFill,
442        eSectionTypeDataObjCMessageRefs,    // Pointer to function pointer + selector
443        eSectionTypeDataObjCCFStrings,      // Objective C const CFString/NSString objects
444        eSectionTypeDWARFDebugAbbrev,
445        eSectionTypeDWARFDebugAranges,
446        eSectionTypeDWARFDebugFrame,
447        eSectionTypeDWARFDebugInfo,
448        eSectionTypeDWARFDebugLine,
449        eSectionTypeDWARFDebugLoc,
450        eSectionTypeDWARFDebugMacInfo,
451        eSectionTypeDWARFDebugPubNames,
452        eSectionTypeDWARFDebugPubTypes,
453        eSectionTypeDWARFDebugRanges,
454        eSectionTypeDWARFDebugStr,
455        eSectionTypeEHFrame,
456        eSectionTypeOther
457
458    } SectionType;
459
460    typedef enum EmulateInstructionOptions
461    {
462        eEmulateInstructionOptionNone               = (0u),
463        eEmulateInstructionOptionAutoAdvancePC      = (1u << 0),
464        eEmulateInstructionOptionIgnoreConditions   = (1u << 1)
465    } EmulateInstructionOptions;
466
467} // namespace lldb
468
469
470#endif  // LLDB_lldb_enumerations_h_
471