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