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