1 //===-- lldb-enumerations.h -------------------------------------*- C++ -*-===//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
8
9 #ifndef LLDB_LLDB_ENUMERATIONS_H
10 #define LLDB_LLDB_ENUMERATIONS_H
11
12 #include <type_traits>
13
14 #ifndef SWIG
15 // Macro to enable bitmask operations on an enum. Without this, Enum | Enum
16 // gets promoted to an int, so you have to say Enum a = Enum(eFoo | eBar). If
17 // you mark Enum with LLDB_MARK_AS_BITMASK_ENUM(Enum), however, you can simply
18 // write Enum a = eFoo | eBar.
19 // Unfortunately, swig<3.0 doesn't recognise the constexpr keyword, so remove
20 // this entire block, as it is not necessary for swig processing.
21 #define LLDB_MARK_AS_BITMASK_ENUM(Enum) \
22 constexpr Enum operator|(Enum a, Enum b) { \
23 return static_cast<Enum>( \
24 static_cast<std::underlying_type<Enum>::type>(a) | \
25 static_cast<std::underlying_type<Enum>::type>(b)); \
26 } \
27 constexpr Enum operator&(Enum a, Enum b) { \
28 return static_cast<Enum>( \
29 static_cast<std::underlying_type<Enum>::type>(a) & \
30 static_cast<std::underlying_type<Enum>::type>(b)); \
31 } \
32 constexpr Enum operator~(Enum a) { \
33 return static_cast<Enum>( \
34 ~static_cast<std::underlying_type<Enum>::type>(a)); \
35 } \
36 inline Enum &operator|=(Enum &a, Enum b) { \
37 a = a | b; \
38 return a; \
39 } \
40 inline Enum &operator&=(Enum &a, Enum b) { \
41 a = a & b; \
42 return a; \
43 }
44 #else
45 #define LLDB_MARK_AS_BITMASK_ENUM(Enum)
46 #endif
47
48 #ifndef SWIG
49 // With MSVC, the default type of an enum is always signed, even if one of the
50 // enumerator values is too large to fit into a signed integer but would
51 // otherwise fit into an unsigned integer. As a result of this, all of LLDB's
52 // flag-style enumerations that specify something like eValueFoo = 1u << 31
53 // result in negative values. This usually just results in a benign warning,
54 // but in a few places we actually do comparisons on the enum values, which
55 // would cause a real bug. Furthermore, there's no way to silence only this
56 // warning, as it's part of -Wmicrosoft which also catches a whole slew of
57 // other useful issues.
58 //
59 // To make matters worse, early versions of SWIG don't recognize the syntax of
60 // specifying the underlying type of an enum (and Python doesn't care anyway)
61 // so we need a way to specify the underlying type when the enum is being used
62 // from C++ code, but just use a regular enum when swig is pre-processing.
63 #define FLAGS_ENUM(Name) enum Name : unsigned
64 #define FLAGS_ANONYMOUS_ENUM() enum : unsigned
65 #else
66 #define FLAGS_ENUM(Name) enum Name
67 #define FLAGS_ANONYMOUS_ENUM() enum
68 #endif
69
70 namespace lldb {
71
72 /// Process and Thread States.
73 enum StateType {
74 eStateInvalid = 0,
75 eStateUnloaded, ///< Process is object is valid, but not currently loaded
76 eStateConnected, ///< Process is connected to remote debug services, but not
77 /// launched or attached to anything yet
78 eStateAttaching, ///< Process is currently trying to attach
79 eStateLaunching, ///< Process is in the process of launching
80 // The state changes eStateAttaching and eStateLaunching are both sent while
81 // the private state thread is either not yet started or paused. For that
82 // reason, they should only be signaled as public state changes, and not
83 // private state changes.
84 eStateStopped, ///< Process or thread is stopped and can be examined.
85 eStateRunning, ///< Process or thread is running and can't be examined.
86 eStateStepping, ///< Process or thread is in the process of stepping and can
87 /// not be examined.
88 eStateCrashed, ///< Process or thread has crashed and can be examined.
89 eStateDetached, ///< Process has been detached and can't be examined.
90 eStateExited, ///< Process has exited and can't be examined.
91 eStateSuspended, ///< Process or thread is in a suspended state as far
92 ///< as the debugger is concerned while other processes
93 ///< or threads get the chance to run.
94 kLastStateType = eStateSuspended
95 };
96
97 /// Launch Flags.
FLAGS_ENUM(LaunchFlags)98 FLAGS_ENUM(LaunchFlags){
99 eLaunchFlagNone = 0u,
100 eLaunchFlagExec = (1u << 0), ///< Exec when launching and turn the calling
101 /// process into a new process
102 eLaunchFlagDebug = (1u << 1), ///< Stop as soon as the process launches to
103 /// allow the process to be debugged
104 eLaunchFlagStopAtEntry = (1u
105 << 2), ///< Stop at the program entry point
106 /// instead of auto-continuing when
107 /// launching or attaching at entry point
108 eLaunchFlagDisableASLR =
109 (1u << 3), ///< Disable Address Space Layout Randomization
110 eLaunchFlagDisableSTDIO =
111 (1u << 4), ///< Disable stdio for inferior process (e.g. for a GUI app)
112 eLaunchFlagLaunchInTTY =
113 (1u << 5), ///< Launch the process in a new TTY if supported by the host
114 eLaunchFlagLaunchInShell =
115 (1u << 6), ///< Launch the process inside a shell to get shell expansion
116 eLaunchFlagLaunchInSeparateProcessGroup =
117 (1u << 7), ///< Launch the process in a separate process group
118 ///< If you are going to hand the process off (e.g. to
119 ///< debugserver)
120 eLaunchFlagDontSetExitStatus = (1u << 8),
121 ///< set this flag so lldb & the handee don't race to set its exit status.
122 eLaunchFlagDetachOnError = (1u << 9), ///< If set, then the client stub
123 ///< should detach rather than killing
124 ///< the debugee
125 ///< if it loses connection with lldb.
126 eLaunchFlagShellExpandArguments =
127 (1u << 10), ///< Perform shell-style argument expansion
128 eLaunchFlagCloseTTYOnExit = (1u << 11), ///< Close the open TTY on exit
129 eLaunchFlagInheritTCCFromParent =
130 (1u << 12), ///< Don't make the inferior responsible for its own TCC
131 ///< permissions but instead inherit them from its parent.
132 };
133
134 /// Thread Run Modes.
135 enum RunMode { eOnlyThisThread, eAllThreads, eOnlyDuringStepping };
136
137 /// Byte ordering definitions.
138 enum ByteOrder {
139 eByteOrderInvalid = 0,
140 eByteOrderBig = 1,
141 eByteOrderPDP = 2,
142 eByteOrderLittle = 4
143 };
144
145 /// Register encoding definitions.
146 enum Encoding {
147 eEncodingInvalid = 0,
148 eEncodingUint, ///< unsigned integer
149 eEncodingSint, ///< signed integer
150 eEncodingIEEE754, ///< float
151 eEncodingVector ///< vector registers
152 };
153
154 /// Display format definitions.
155 enum Format {
156 eFormatDefault = 0,
157 eFormatInvalid = 0,
158 eFormatBoolean,
159 eFormatBinary,
160 eFormatBytes,
161 eFormatBytesWithASCII,
162 eFormatChar,
163 eFormatCharPrintable, ///< Only printable characters, '.' if not printable
164 eFormatComplex, ///< Floating point complex type
165 eFormatComplexFloat = eFormatComplex,
166 eFormatCString, ///< NULL terminated C strings
167 eFormatDecimal,
168 eFormatEnum,
169 eFormatHex,
170 eFormatHexUppercase,
171 eFormatFloat,
172 eFormatOctal,
173 eFormatOSType, ///< OS character codes encoded into an integer 'PICT' 'text'
174 ///< etc...
175 eFormatUnicode16,
176 eFormatUnicode32,
177 eFormatUnsigned,
178 eFormatPointer,
179 eFormatVectorOfChar,
180 eFormatVectorOfSInt8,
181 eFormatVectorOfUInt8,
182 eFormatVectorOfSInt16,
183 eFormatVectorOfUInt16,
184 eFormatVectorOfSInt32,
185 eFormatVectorOfUInt32,
186 eFormatVectorOfSInt64,
187 eFormatVectorOfUInt64,
188 eFormatVectorOfFloat16,
189 eFormatVectorOfFloat32,
190 eFormatVectorOfFloat64,
191 eFormatVectorOfUInt128,
192 eFormatComplexInteger, ///< Integer complex type
193 eFormatCharArray, ///< Print characters with no single quotes, used for
194 ///< character arrays that can contain non printable
195 ///< characters
196 eFormatAddressInfo, ///< Describe what an address points to (func + offset
197 ///< with file/line, symbol + offset, data, etc)
198 eFormatHexFloat, ///< ISO C99 hex float string
199 eFormatInstruction, ///< Disassemble an opcode
200 eFormatVoid, ///< Do not print this
201 eFormatUnicode8,
202 kNumFormats
203 };
204
205 /// Description levels for "void GetDescription(Stream *, DescriptionLevel)"
206 /// calls.
207 enum DescriptionLevel {
208 eDescriptionLevelBrief = 0,
209 eDescriptionLevelFull,
210 eDescriptionLevelVerbose,
211 eDescriptionLevelInitial,
212 kNumDescriptionLevels
213 };
214
215 /// Script interpreter types.
216 enum ScriptLanguage {
217 eScriptLanguageNone = 0,
218 eScriptLanguagePython,
219 eScriptLanguageLua,
220 eScriptLanguageUnknown,
221 eScriptLanguageDefault = eScriptLanguagePython
222 };
223
224 /// Register numbering types.
225 // See RegisterContext::ConvertRegisterKindToRegisterNumber to convert any of
226 // these to the lldb internal register numbering scheme (eRegisterKindLLDB).
227 enum RegisterKind {
228 eRegisterKindEHFrame = 0, ///< the register numbers seen in eh_frame
229 eRegisterKindDWARF, ///< the register numbers seen DWARF
230 eRegisterKindGeneric, ///< insn ptr reg, stack ptr reg, etc not specific to
231 ///< any particular target
232 eRegisterKindProcessPlugin, ///< num used by the process plugin - e.g. by the
233 ///< remote gdb-protocol stub program
234 eRegisterKindLLDB, ///< lldb's internal register numbers
235 kNumRegisterKinds
236 };
237
238 /// Thread stop reasons.
239 enum StopReason {
240 eStopReasonInvalid = 0,
241 eStopReasonNone,
242 eStopReasonTrace,
243 eStopReasonBreakpoint,
244 eStopReasonWatchpoint,
245 eStopReasonSignal,
246 eStopReasonException,
247 eStopReasonExec, ///< Program was re-exec'ed
248 eStopReasonPlanComplete,
249 eStopReasonThreadExiting,
250 eStopReasonInstrumentation,
251 eStopReasonProcessorTrace,
252 eStopReasonFork,
253 eStopReasonVFork,
254 eStopReasonVForkDone,
255 };
256
257 /// Command Return Status Types.
258 enum ReturnStatus {
259 eReturnStatusInvalid,
260 eReturnStatusSuccessFinishNoResult,
261 eReturnStatusSuccessFinishResult,
262 eReturnStatusSuccessContinuingNoResult,
263 eReturnStatusSuccessContinuingResult,
264 eReturnStatusStarted,
265 eReturnStatusFailed,
266 eReturnStatusQuit
267 };
268
269 /// The results of expression evaluation.
270 enum ExpressionResults {
271 eExpressionCompleted = 0,
272 eExpressionSetupError,
273 eExpressionParseError,
274 eExpressionDiscarded,
275 eExpressionInterrupted,
276 eExpressionHitBreakpoint,
277 eExpressionTimedOut,
278 eExpressionResultUnavailable,
279 eExpressionStoppedForDebug,
280 eExpressionThreadVanished
281 };
282
283 enum SearchDepth {
284 eSearchDepthInvalid = 0,
285 eSearchDepthTarget,
286 eSearchDepthModule,
287 eSearchDepthCompUnit,
288 eSearchDepthFunction,
289 eSearchDepthBlock,
290 eSearchDepthAddress,
291 kLastSearchDepthKind = eSearchDepthAddress
292 };
293
294 /// Connection Status Types.
295 enum ConnectionStatus {
296 eConnectionStatusSuccess, ///< Success
297 eConnectionStatusEndOfFile, ///< End-of-file encountered
298 eConnectionStatusError, ///< Check GetError() for details
299 eConnectionStatusTimedOut, ///< Request timed out
300 eConnectionStatusNoConnection, ///< No connection
301 eConnectionStatusLostConnection, ///< Lost connection while connected to a
302 ///< valid connection
303 eConnectionStatusInterrupted ///< Interrupted read
304 };
305
306 enum ErrorType {
307 eErrorTypeInvalid,
308 eErrorTypeGeneric, ///< Generic errors that can be any value.
309 eErrorTypeMachKernel, ///< Mach kernel error codes.
310 eErrorTypePOSIX, ///< POSIX error codes.
311 eErrorTypeExpression, ///< These are from the ExpressionResults enum.
312 eErrorTypeWin32 ///< Standard Win32 error codes.
313 };
314
315 enum ValueType {
316 eValueTypeInvalid = 0,
317 eValueTypeVariableGlobal = 1, ///< globals variable
318 eValueTypeVariableStatic = 2, ///< static variable
319 eValueTypeVariableArgument = 3, ///< function argument variables
320 eValueTypeVariableLocal = 4, ///< function local variables
321 eValueTypeRegister = 5, ///< stack frame register value
322 eValueTypeRegisterSet = 6, ///< A collection of stack frame register values
323 eValueTypeConstResult = 7, ///< constant result variables
324 eValueTypeVariableThreadLocal = 8 ///< thread local storage variable
325 };
326
327 /// Token size/granularities for Input Readers.
328
329 enum InputReaderGranularity {
330 eInputReaderGranularityInvalid = 0,
331 eInputReaderGranularityByte,
332 eInputReaderGranularityWord,
333 eInputReaderGranularityLine,
334 eInputReaderGranularityAll
335 };
336
337 /// These mask bits allow a common interface for queries that can
338 /// limit the amount of information that gets parsed to only the
339 /// information that is requested. These bits also can indicate what
340 /// actually did get resolved during query function calls.
341 ///
342 /// Each definition corresponds to a one of the member variables
343 /// in this class, and requests that that item be resolved, or
344 /// indicates that the member did get resolved.
FLAGS_ENUM(SymbolContextItem)345 FLAGS_ENUM(SymbolContextItem){
346 /// Set when \a target is requested from a query, or was located
347 /// in query results
348 eSymbolContextTarget = (1u << 0),
349 /// Set when \a module is requested from a query, or was located
350 /// in query results
351 eSymbolContextModule = (1u << 1),
352 /// Set when \a comp_unit is requested from a query, or was
353 /// located in query results
354 eSymbolContextCompUnit = (1u << 2),
355 /// Set when \a function is requested from a query, or was located
356 /// in query results
357 eSymbolContextFunction = (1u << 3),
358 /// Set when the deepest \a block is requested from a query, or
359 /// was located in query results
360 eSymbolContextBlock = (1u << 4),
361 /// Set when \a line_entry is requested from a query, or was
362 /// located in query results
363 eSymbolContextLineEntry = (1u << 5),
364 /// Set when \a symbol is requested from a query, or was located
365 /// in query results
366 eSymbolContextSymbol = (1u << 6),
367 /// Indicates to try and lookup everything up during a routine
368 /// symbol context query.
369 eSymbolContextEverything = ((eSymbolContextSymbol << 1) - 1u),
370 /// Set when \a global or static variable is requested from a
371 /// query, or was located in query results.
372 /// eSymbolContextVariable is potentially expensive to lookup so
373 /// it isn't included in eSymbolContextEverything which stops it
374 /// from being used during frame PC lookups and many other
375 /// potential address to symbol context lookups.
376 eSymbolContextVariable = (1u << 7),
377 };
378 LLDB_MARK_AS_BITMASK_ENUM(SymbolContextItem)
379
FLAGS_ENUM(Permissions)380 FLAGS_ENUM(Permissions){ePermissionsWritable = (1u << 0),
381 ePermissionsReadable = (1u << 1),
382 ePermissionsExecutable = (1u << 2)};
383 LLDB_MARK_AS_BITMASK_ENUM(Permissions)
384
385 enum InputReaderAction {
386 eInputReaderActivate, ///< reader is newly pushed onto the reader stack
387 eInputReaderAsynchronousOutputWritten, ///< an async output event occurred;
388 ///< the reader may want to do
389 ///< something
390 eInputReaderReactivate, ///< reader is on top of the stack again after another
391 ///< reader was popped off
392 eInputReaderDeactivate, ///< another reader was pushed on the stack
393 eInputReaderGotToken, ///< reader got one of its tokens (granularity)
394 eInputReaderInterrupt, ///< reader received an interrupt signal (probably from
395 ///< a control-c)
396 eInputReaderEndOfFile, ///< reader received an EOF char (probably from a
397 ///< control-d)
398 eInputReaderDone ///< reader was just popped off the stack and is done
399 };
400
FLAGS_ENUM(BreakpointEventType)401 FLAGS_ENUM(BreakpointEventType){
402 eBreakpointEventTypeInvalidType = (1u << 0),
403 eBreakpointEventTypeAdded = (1u << 1),
404 eBreakpointEventTypeRemoved = (1u << 2),
405 eBreakpointEventTypeLocationsAdded = (1u << 3), ///< Locations added doesn't
406 ///< get sent when the
407 ///< breakpoint is created
408 eBreakpointEventTypeLocationsRemoved = (1u << 4),
409 eBreakpointEventTypeLocationsResolved = (1u << 5),
410 eBreakpointEventTypeEnabled = (1u << 6),
411 eBreakpointEventTypeDisabled = (1u << 7),
412 eBreakpointEventTypeCommandChanged = (1u << 8),
413 eBreakpointEventTypeConditionChanged = (1u << 9),
414 eBreakpointEventTypeIgnoreChanged = (1u << 10),
415 eBreakpointEventTypeThreadChanged = (1u << 11),
416 eBreakpointEventTypeAutoContinueChanged = (1u << 12)};
417
FLAGS_ENUM(WatchpointEventType)418 FLAGS_ENUM(WatchpointEventType){
419 eWatchpointEventTypeInvalidType = (1u << 0),
420 eWatchpointEventTypeAdded = (1u << 1),
421 eWatchpointEventTypeRemoved = (1u << 2),
422 eWatchpointEventTypeEnabled = (1u << 6),
423 eWatchpointEventTypeDisabled = (1u << 7),
424 eWatchpointEventTypeCommandChanged = (1u << 8),
425 eWatchpointEventTypeConditionChanged = (1u << 9),
426 eWatchpointEventTypeIgnoreChanged = (1u << 10),
427 eWatchpointEventTypeThreadChanged = (1u << 11),
428 eWatchpointEventTypeTypeChanged = (1u << 12)};
429
430 /// Programming language type.
431 ///
432 /// These enumerations use the same language enumerations as the DWARF
433 /// specification for ease of use and consistency.
434 /// The enum -> string code is in Language.cpp, don't change this
435 /// table without updating that code as well.
436 enum LanguageType {
437 eLanguageTypeUnknown = 0x0000, ///< Unknown or invalid language value.
438 eLanguageTypeC89 = 0x0001, ///< ISO C:1989.
439 eLanguageTypeC = 0x0002, ///< Non-standardized C, such as K&R.
440 eLanguageTypeAda83 = 0x0003, ///< ISO Ada:1983.
441 eLanguageTypeC_plus_plus = 0x0004, ///< ISO C++:1998.
442 eLanguageTypeCobol74 = 0x0005, ///< ISO Cobol:1974.
443 eLanguageTypeCobol85 = 0x0006, ///< ISO Cobol:1985.
444 eLanguageTypeFortran77 = 0x0007, ///< ISO Fortran 77.
445 eLanguageTypeFortran90 = 0x0008, ///< ISO Fortran 90.
446 eLanguageTypePascal83 = 0x0009, ///< ISO Pascal:1983.
447 eLanguageTypeModula2 = 0x000a, ///< ISO Modula-2:1996.
448 eLanguageTypeJava = 0x000b, ///< Java.
449 eLanguageTypeC99 = 0x000c, ///< ISO C:1999.
450 eLanguageTypeAda95 = 0x000d, ///< ISO Ada:1995.
451 eLanguageTypeFortran95 = 0x000e, ///< ISO Fortran 95.
452 eLanguageTypePLI = 0x000f, ///< ANSI PL/I:1976.
453 eLanguageTypeObjC = 0x0010, ///< Objective-C.
454 eLanguageTypeObjC_plus_plus = 0x0011, ///< Objective-C++.
455 eLanguageTypeUPC = 0x0012, ///< Unified Parallel C.
456 eLanguageTypeD = 0x0013, ///< D.
457 eLanguageTypePython = 0x0014, ///< Python.
458 // NOTE: The below are DWARF5 constants, subject to change upon
459 // completion of the DWARF5 specification
460 eLanguageTypeOpenCL = 0x0015, ///< OpenCL.
461 eLanguageTypeGo = 0x0016, ///< Go.
462 eLanguageTypeModula3 = 0x0017, ///< Modula 3.
463 eLanguageTypeHaskell = 0x0018, ///< Haskell.
464 eLanguageTypeC_plus_plus_03 = 0x0019, ///< ISO C++:2003.
465 eLanguageTypeC_plus_plus_11 = 0x001a, ///< ISO C++:2011.
466 eLanguageTypeOCaml = 0x001b, ///< OCaml.
467 eLanguageTypeRust = 0x001c, ///< Rust.
468 eLanguageTypeC11 = 0x001d, ///< ISO C:2011.
469 eLanguageTypeSwift = 0x001e, ///< Swift.
470 eLanguageTypeJulia = 0x001f, ///< Julia.
471 eLanguageTypeDylan = 0x0020, ///< Dylan.
472 eLanguageTypeC_plus_plus_14 = 0x0021, ///< ISO C++:2014.
473 eLanguageTypeFortran03 = 0x0022, ///< ISO Fortran 2003.
474 eLanguageTypeFortran08 = 0x0023, ///< ISO Fortran 2008.
475 // Vendor Extensions
476 // Note: Language::GetNameForLanguageType
477 // assumes these can be used as indexes into array language_names, and
478 // Language::SetLanguageFromCString and Language::AsCString assume these can
479 // be used as indexes into array g_languages.
480 eLanguageTypeMipsAssembler = 0x0024, ///< Mips_Assembler.
481 eLanguageTypeExtRenderScript = 0x0025, ///< RenderScript.
482 eNumLanguageTypes
483 };
484
485 enum InstrumentationRuntimeType {
486 eInstrumentationRuntimeTypeAddressSanitizer = 0x0000,
487 eInstrumentationRuntimeTypeThreadSanitizer = 0x0001,
488 eInstrumentationRuntimeTypeUndefinedBehaviorSanitizer = 0x0002,
489 eInstrumentationRuntimeTypeMainThreadChecker = 0x0003,
490 eInstrumentationRuntimeTypeSwiftRuntimeReporting = 0x0004,
491 eNumInstrumentationRuntimeTypes
492 };
493
494 enum DynamicValueType {
495 eNoDynamicValues = 0,
496 eDynamicCanRunTarget = 1,
497 eDynamicDontRunTarget = 2
498 };
499
500 enum StopShowColumn {
501 eStopShowColumnAnsiOrCaret = 0,
502 eStopShowColumnAnsi = 1,
503 eStopShowColumnCaret = 2,
504 eStopShowColumnNone = 3
505 };
506
507 enum AccessType {
508 eAccessNone,
509 eAccessPublic,
510 eAccessPrivate,
511 eAccessProtected,
512 eAccessPackage
513 };
514
515 enum CommandArgumentType {
516 eArgTypeAddress = 0,
517 eArgTypeAddressOrExpression,
518 eArgTypeAliasName,
519 eArgTypeAliasOptions,
520 eArgTypeArchitecture,
521 eArgTypeBoolean,
522 eArgTypeBreakpointID,
523 eArgTypeBreakpointIDRange,
524 eArgTypeBreakpointName,
525 eArgTypeByteSize,
526 eArgTypeClassName,
527 eArgTypeCommandName,
528 eArgTypeCount,
529 eArgTypeDescriptionVerbosity,
530 eArgTypeDirectoryName,
531 eArgTypeDisassemblyFlavor,
532 eArgTypeEndAddress,
533 eArgTypeExpression,
534 eArgTypeExpressionPath,
535 eArgTypeExprFormat,
536 eArgTypeFileLineColumn,
537 eArgTypeFilename,
538 eArgTypeFormat,
539 eArgTypeFrameIndex,
540 eArgTypeFullName,
541 eArgTypeFunctionName,
542 eArgTypeFunctionOrSymbol,
543 eArgTypeGDBFormat,
544 eArgTypeHelpText,
545 eArgTypeIndex,
546 eArgTypeLanguage,
547 eArgTypeLineNum,
548 eArgTypeLogCategory,
549 eArgTypeLogChannel,
550 eArgTypeMethod,
551 eArgTypeName,
552 eArgTypeNewPathPrefix,
553 eArgTypeNumLines,
554 eArgTypeNumberPerLine,
555 eArgTypeOffset,
556 eArgTypeOldPathPrefix,
557 eArgTypeOneLiner,
558 eArgTypePath,
559 eArgTypePermissionsNumber,
560 eArgTypePermissionsString,
561 eArgTypePid,
562 eArgTypePlugin,
563 eArgTypeProcessName,
564 eArgTypePythonClass,
565 eArgTypePythonFunction,
566 eArgTypePythonScript,
567 eArgTypeQueueName,
568 eArgTypeRegisterName,
569 eArgTypeRegularExpression,
570 eArgTypeRunArgs,
571 eArgTypeRunMode,
572 eArgTypeScriptedCommandSynchronicity,
573 eArgTypeScriptLang,
574 eArgTypeSearchWord,
575 eArgTypeSelector,
576 eArgTypeSettingIndex,
577 eArgTypeSettingKey,
578 eArgTypeSettingPrefix,
579 eArgTypeSettingVariableName,
580 eArgTypeShlibName,
581 eArgTypeSourceFile,
582 eArgTypeSortOrder,
583 eArgTypeStartAddress,
584 eArgTypeSummaryString,
585 eArgTypeSymbol,
586 eArgTypeThreadID,
587 eArgTypeThreadIndex,
588 eArgTypeThreadName,
589 eArgTypeTypeName,
590 eArgTypeUnsignedInteger,
591 eArgTypeUnixSignal,
592 eArgTypeVarName,
593 eArgTypeValue,
594 eArgTypeWidth,
595 eArgTypeNone,
596 eArgTypePlatform,
597 eArgTypeWatchpointID,
598 eArgTypeWatchpointIDRange,
599 eArgTypeWatchType,
600 eArgRawInput,
601 eArgTypeCommand,
602 eArgTypeColumnNum,
603 eArgTypeModuleUUID,
604 eArgTypeSaveCoreStyle,
605 eArgTypeLogHandler,
606 eArgTypeSEDStylePair,
607 eArgTypeRecognizerID,
608 eArgTypeConnectURL,
609 eArgTypeTargetID,
610 eArgTypeStopHookID,
611 eArgTypeReproducerProvider,
612 eArgTypeReproducerSignal,
613 eArgTypeLastArg // Always keep this entry as the last entry in this
614 // enumeration!!
615 };
616
617 /// Symbol types.
618 // Symbol holds the SymbolType in a 6-bit field (m_type), so if you get over 63
619 // entries you will have to resize that field.
620 enum SymbolType {
621 eSymbolTypeAny = 0,
622 eSymbolTypeInvalid = 0,
623 eSymbolTypeAbsolute,
624 eSymbolTypeCode,
625 eSymbolTypeResolver,
626 eSymbolTypeData,
627 eSymbolTypeTrampoline,
628 eSymbolTypeRuntime,
629 eSymbolTypeException,
630 eSymbolTypeSourceFile,
631 eSymbolTypeHeaderFile,
632 eSymbolTypeObjectFile,
633 eSymbolTypeCommonBlock,
634 eSymbolTypeBlock,
635 eSymbolTypeLocal,
636 eSymbolTypeParam,
637 eSymbolTypeVariable,
638 eSymbolTypeVariableType,
639 eSymbolTypeLineEntry,
640 eSymbolTypeLineHeader,
641 eSymbolTypeScopeBegin,
642 eSymbolTypeScopeEnd,
643 eSymbolTypeAdditional, ///< When symbols take more than one entry, the extra
644 ///< entries get this type
645 eSymbolTypeCompiler,
646 eSymbolTypeInstrumentation,
647 eSymbolTypeUndefined,
648 eSymbolTypeObjCClass,
649 eSymbolTypeObjCMetaClass,
650 eSymbolTypeObjCIVar,
651 eSymbolTypeReExported
652 };
653
654 enum SectionType {
655 eSectionTypeInvalid,
656 eSectionTypeCode,
657 eSectionTypeContainer, ///< The section contains child sections
658 eSectionTypeData,
659 eSectionTypeDataCString, ///< Inlined C string data
660 eSectionTypeDataCStringPointers, ///< Pointers to C string data
661 eSectionTypeDataSymbolAddress, ///< Address of a symbol in the symbol table
662 eSectionTypeData4,
663 eSectionTypeData8,
664 eSectionTypeData16,
665 eSectionTypeDataPointers,
666 eSectionTypeDebug,
667 eSectionTypeZeroFill,
668 eSectionTypeDataObjCMessageRefs, ///< Pointer to function pointer + selector
669 eSectionTypeDataObjCCFStrings, ///< Objective-C const CFString/NSString
670 ///< objects
671 eSectionTypeDWARFDebugAbbrev,
672 eSectionTypeDWARFDebugAddr,
673 eSectionTypeDWARFDebugAranges,
674 eSectionTypeDWARFDebugCuIndex,
675 eSectionTypeDWARFDebugFrame,
676 eSectionTypeDWARFDebugInfo,
677 eSectionTypeDWARFDebugLine,
678 eSectionTypeDWARFDebugLoc,
679 eSectionTypeDWARFDebugMacInfo,
680 eSectionTypeDWARFDebugMacro,
681 eSectionTypeDWARFDebugPubNames,
682 eSectionTypeDWARFDebugPubTypes,
683 eSectionTypeDWARFDebugRanges,
684 eSectionTypeDWARFDebugStr,
685 eSectionTypeDWARFDebugStrOffsets,
686 eSectionTypeDWARFAppleNames,
687 eSectionTypeDWARFAppleTypes,
688 eSectionTypeDWARFAppleNamespaces,
689 eSectionTypeDWARFAppleObjC,
690 eSectionTypeELFSymbolTable, ///< Elf SHT_SYMTAB section
691 eSectionTypeELFDynamicSymbols, ///< Elf SHT_DYNSYM section
692 eSectionTypeELFRelocationEntries, ///< Elf SHT_REL or SHT_REL section
693 eSectionTypeELFDynamicLinkInfo, ///< Elf SHT_DYNAMIC section
694 eSectionTypeEHFrame,
695 eSectionTypeARMexidx,
696 eSectionTypeARMextab,
697 eSectionTypeCompactUnwind, ///< compact unwind section in Mach-O,
698 ///< __TEXT,__unwind_info
699 eSectionTypeGoSymtab,
700 eSectionTypeAbsoluteAddress, ///< Dummy section for symbols with absolute
701 ///< address
702 eSectionTypeDWARFGNUDebugAltLink,
703 eSectionTypeDWARFDebugTypes, ///< DWARF .debug_types section
704 eSectionTypeDWARFDebugNames, ///< DWARF v5 .debug_names
705 eSectionTypeOther,
706 eSectionTypeDWARFDebugLineStr, ///< DWARF v5 .debug_line_str
707 eSectionTypeDWARFDebugRngLists, ///< DWARF v5 .debug_rnglists
708 eSectionTypeDWARFDebugLocLists, ///< DWARF v5 .debug_loclists
709 eSectionTypeDWARFDebugAbbrevDwo,
710 eSectionTypeDWARFDebugInfoDwo,
711 eSectionTypeDWARFDebugStrDwo,
712 eSectionTypeDWARFDebugStrOffsetsDwo,
713 eSectionTypeDWARFDebugTypesDwo,
714 eSectionTypeDWARFDebugRngListsDwo,
715 eSectionTypeDWARFDebugLocDwo,
716 eSectionTypeDWARFDebugLocListsDwo,
717 eSectionTypeDWARFDebugTuIndex,
718 };
719
FLAGS_ENUM(EmulateInstructionOptions)720 FLAGS_ENUM(EmulateInstructionOptions){
721 eEmulateInstructionOptionNone = (0u),
722 eEmulateInstructionOptionAutoAdvancePC = (1u << 0),
723 eEmulateInstructionOptionIgnoreConditions = (1u << 1)};
724
FLAGS_ENUM(FunctionNameType)725 FLAGS_ENUM(FunctionNameType){
726 eFunctionNameTypeNone = 0u,
727 eFunctionNameTypeAuto =
728 (1u << 1), ///< Automatically figure out which FunctionNameType
729 ///< bits to set based on the function name.
730 eFunctionNameTypeFull = (1u << 2), ///< The function name.
731 ///< For C this is the same as just the name of the function For C++ this is
732 ///< the mangled or demangled version of the mangled name. For ObjC this is
733 ///< the full function signature with the + or - and the square brackets and
734 ///< the class and selector
735 eFunctionNameTypeBase = (1u
736 << 3), ///< The function name only, no namespaces
737 ///< or arguments and no class
738 ///< methods or selectors will be searched.
739 eFunctionNameTypeMethod = (1u << 4), ///< Find function by method name (C++)
740 ///< with no namespace or arguments
741 eFunctionNameTypeSelector =
742 (1u << 5), ///< Find function by selector name (ObjC) names
743 eFunctionNameTypeAny =
744 eFunctionNameTypeAuto ///< DEPRECATED: use eFunctionNameTypeAuto
745 };
746 LLDB_MARK_AS_BITMASK_ENUM(FunctionNameType)
747
748 /// Basic types enumeration for the public API SBType::GetBasicType().
749 enum BasicType {
750 eBasicTypeInvalid = 0,
751 eBasicTypeVoid = 1,
752 eBasicTypeChar,
753 eBasicTypeSignedChar,
754 eBasicTypeUnsignedChar,
755 eBasicTypeWChar,
756 eBasicTypeSignedWChar,
757 eBasicTypeUnsignedWChar,
758 eBasicTypeChar16,
759 eBasicTypeChar32,
760 eBasicTypeChar8,
761 eBasicTypeShort,
762 eBasicTypeUnsignedShort,
763 eBasicTypeInt,
764 eBasicTypeUnsignedInt,
765 eBasicTypeLong,
766 eBasicTypeUnsignedLong,
767 eBasicTypeLongLong,
768 eBasicTypeUnsignedLongLong,
769 eBasicTypeInt128,
770 eBasicTypeUnsignedInt128,
771 eBasicTypeBool,
772 eBasicTypeHalf,
773 eBasicTypeFloat,
774 eBasicTypeDouble,
775 eBasicTypeLongDouble,
776 eBasicTypeFloatComplex,
777 eBasicTypeDoubleComplex,
778 eBasicTypeLongDoubleComplex,
779 eBasicTypeObjCID,
780 eBasicTypeObjCClass,
781 eBasicTypeObjCSel,
782 eBasicTypeNullPtr,
783 eBasicTypeOther
784 };
785
786 /// Deprecated
787 enum TraceType {
788 eTraceTypeNone = 0,
789
790 /// Intel Processor Trace
791 eTraceTypeProcessorTrace
792 };
793
794 enum StructuredDataType {
795 eStructuredDataTypeInvalid = -1,
796 eStructuredDataTypeNull = 0,
797 eStructuredDataTypeGeneric,
798 eStructuredDataTypeArray,
799 eStructuredDataTypeInteger,
800 eStructuredDataTypeFloat,
801 eStructuredDataTypeBoolean,
802 eStructuredDataTypeString,
803 eStructuredDataTypeDictionary
804 };
805
FLAGS_ENUM(TypeClass)806 FLAGS_ENUM(TypeClass){
807 eTypeClassInvalid = (0u), eTypeClassArray = (1u << 0),
808 eTypeClassBlockPointer = (1u << 1), eTypeClassBuiltin = (1u << 2),
809 eTypeClassClass = (1u << 3), eTypeClassComplexFloat = (1u << 4),
810 eTypeClassComplexInteger = (1u << 5), eTypeClassEnumeration = (1u << 6),
811 eTypeClassFunction = (1u << 7), eTypeClassMemberPointer = (1u << 8),
812 eTypeClassObjCObject = (1u << 9), eTypeClassObjCInterface = (1u << 10),
813 eTypeClassObjCObjectPointer = (1u << 11), eTypeClassPointer = (1u << 12),
814 eTypeClassReference = (1u << 13), eTypeClassStruct = (1u << 14),
815 eTypeClassTypedef = (1u << 15), eTypeClassUnion = (1u << 16),
816 eTypeClassVector = (1u << 17),
817 // Define the last type class as the MSBit of a 32 bit value
818 eTypeClassOther = (1u << 31),
819 // Define a mask that can be used for any type when finding types
820 eTypeClassAny = (0xffffffffu)};
821 LLDB_MARK_AS_BITMASK_ENUM(TypeClass)
822
823 enum TemplateArgumentKind {
824 eTemplateArgumentKindNull = 0,
825 eTemplateArgumentKindType,
826 eTemplateArgumentKindDeclaration,
827 eTemplateArgumentKindIntegral,
828 eTemplateArgumentKindTemplate,
829 eTemplateArgumentKindTemplateExpansion,
830 eTemplateArgumentKindExpression,
831 eTemplateArgumentKindPack,
832 eTemplateArgumentKindNullPtr,
833 };
834
835 /// Options that can be set for a formatter to alter its behavior. Not
836 /// all of these are applicable to all formatter types.
FLAGS_ENUM(TypeOptions)837 FLAGS_ENUM(TypeOptions){eTypeOptionNone = (0u),
838 eTypeOptionCascade = (1u << 0),
839 eTypeOptionSkipPointers = (1u << 1),
840 eTypeOptionSkipReferences = (1u << 2),
841 eTypeOptionHideChildren = (1u << 3),
842 eTypeOptionHideValue = (1u << 4),
843 eTypeOptionShowOneLiner = (1u << 5),
844 eTypeOptionHideNames = (1u << 6),
845 eTypeOptionNonCacheable = (1u << 7),
846 eTypeOptionHideEmptyAggregates = (1u << 8),
847 eTypeOptionFrontEndWantsDereference = (1u << 9)};
848
849 /// This is the return value for frame comparisons. If you are comparing frame
850 /// A to frame B the following cases arise:
851 ///
852 /// 1) When frame A pushes frame B (or a frame that ends up pushing
853 /// B) A is Older than B.
854 ///
855 /// 2) When frame A pushed frame B (or if frameA is on the stack
856 /// but B is not) A is Younger than B.
857 ///
858 /// 3) When frame A and frame B have the same StackID, they are
859 /// Equal.
860 ///
861 /// 4) When frame A and frame B have the same immediate parent
862 /// frame, but are not equal, the comparison yields SameParent.
863 ///
864 /// 5) If the two frames are on different threads or processes the
865 /// comparison is Invalid.
866 ///
867 /// 6) If for some reason we can't figure out what went on, we
868 /// return Unknown.
869 enum FrameComparison {
870 eFrameCompareInvalid,
871 eFrameCompareUnknown,
872 eFrameCompareEqual,
873 eFrameCompareSameParent,
874 eFrameCompareYounger,
875 eFrameCompareOlder
876 };
877
878 /// File Permissions.
879 ///
880 /// Designed to mimic the unix file permission bits so they can be used with
881 /// functions that set 'mode_t' to certain values for permissions.
FLAGS_ENUM(FilePermissions)882 FLAGS_ENUM(FilePermissions){
883 eFilePermissionsUserRead = (1u << 8),
884 eFilePermissionsUserWrite = (1u << 7),
885 eFilePermissionsUserExecute = (1u << 6),
886 eFilePermissionsGroupRead = (1u << 5),
887 eFilePermissionsGroupWrite = (1u << 4),
888 eFilePermissionsGroupExecute = (1u << 3),
889 eFilePermissionsWorldRead = (1u << 2),
890 eFilePermissionsWorldWrite = (1u << 1),
891 eFilePermissionsWorldExecute = (1u << 0),
892
893 eFilePermissionsUserRW = (eFilePermissionsUserRead |
894 eFilePermissionsUserWrite | 0),
895 eFileFilePermissionsUserRX = (eFilePermissionsUserRead | 0 |
896 eFilePermissionsUserExecute),
897 eFilePermissionsUserRWX = (eFilePermissionsUserRead |
898 eFilePermissionsUserWrite |
899 eFilePermissionsUserExecute),
900
901 eFilePermissionsGroupRW = (eFilePermissionsGroupRead |
902 eFilePermissionsGroupWrite | 0),
903 eFilePermissionsGroupRX = (eFilePermissionsGroupRead | 0 |
904 eFilePermissionsGroupExecute),
905 eFilePermissionsGroupRWX = (eFilePermissionsGroupRead |
906 eFilePermissionsGroupWrite |
907 eFilePermissionsGroupExecute),
908
909 eFilePermissionsWorldRW = (eFilePermissionsWorldRead |
910 eFilePermissionsWorldWrite | 0),
911 eFilePermissionsWorldRX = (eFilePermissionsWorldRead | 0 |
912 eFilePermissionsWorldExecute),
913 eFilePermissionsWorldRWX = (eFilePermissionsWorldRead |
914 eFilePermissionsWorldWrite |
915 eFilePermissionsWorldExecute),
916
917 eFilePermissionsEveryoneR = (eFilePermissionsUserRead |
918 eFilePermissionsGroupRead |
919 eFilePermissionsWorldRead),
920 eFilePermissionsEveryoneW = (eFilePermissionsUserWrite |
921 eFilePermissionsGroupWrite |
922 eFilePermissionsWorldWrite),
923 eFilePermissionsEveryoneX = (eFilePermissionsUserExecute |
924 eFilePermissionsGroupExecute |
925 eFilePermissionsWorldExecute),
926
927 eFilePermissionsEveryoneRW = (eFilePermissionsEveryoneR |
928 eFilePermissionsEveryoneW | 0),
929 eFilePermissionsEveryoneRX = (eFilePermissionsEveryoneR | 0 |
930 eFilePermissionsEveryoneX),
931 eFilePermissionsEveryoneRWX = (eFilePermissionsEveryoneR |
932 eFilePermissionsEveryoneW |
933 eFilePermissionsEveryoneX),
934 eFilePermissionsFileDefault = eFilePermissionsUserRW,
935 eFilePermissionsDirectoryDefault = eFilePermissionsUserRWX,
936 };
937
938 /// Queue work item types.
939 ///
940 /// The different types of work that can be enqueued on a libdispatch aka Grand
941 /// Central Dispatch (GCD) queue.
942 enum QueueItemKind {
943 eQueueItemKindUnknown = 0,
944 eQueueItemKindFunction,
945 eQueueItemKindBlock
946 };
947
948 /// Queue type.
949 ///
950 /// libdispatch aka Grand Central Dispatch (GCD) queues can be either
951 /// serial (executing on one thread) or concurrent (executing on
952 /// multiple threads).
953 enum QueueKind {
954 eQueueKindUnknown = 0,
955 eQueueKindSerial,
956 eQueueKindConcurrent
957 };
958
959 /// Expression Evaluation Stages.
960 ///
961 /// These are the cancellable stages of expression evaluation, passed
962 /// to the expression evaluation callback, so that you can interrupt
963 /// expression evaluation at the various points in its lifecycle.
964 enum ExpressionEvaluationPhase {
965 eExpressionEvaluationParse = 0,
966 eExpressionEvaluationIRGen,
967 eExpressionEvaluationExecution,
968 eExpressionEvaluationComplete
969 };
970
971 /// Architecture-agnostic categorization of instructions for traversing the
972 /// control flow of a trace.
973 ///
974 /// A single instruction can match one or more of these categories.
975 enum InstructionControlFlowKind {
976 /// The instruction could not be classified.
977 eInstructionControlFlowKindUnknown = 0,
978 /// The instruction is something not listed below, i.e. it's a sequential
979 /// instruction that doesn't affect the control flow of the program.
980 eInstructionControlFlowKindOther,
981 /// The instruction is a near (function) call.
982 eInstructionControlFlowKindCall,
983 /// The instruction is a near (function) return.
984 eInstructionControlFlowKindReturn,
985 /// The instruction is a near unconditional jump.
986 eInstructionControlFlowKindJump,
987 /// The instruction is a near conditional jump.
988 eInstructionControlFlowKindCondJump,
989 /// The instruction is a call-like far transfer.
990 /// E.g. SYSCALL, SYSENTER, or FAR CALL.
991 eInstructionControlFlowKindFarCall,
992 /// The instruction is a return-like far transfer.
993 /// E.g. SYSRET, SYSEXIT, IRET, or FAR RET.
994 eInstructionControlFlowKindFarReturn,
995 /// The instruction is a jump-like far transfer.
996 /// E.g. FAR JMP.
997 eInstructionControlFlowKindFarJump
998 };
999
1000 /// Watchpoint Kind.
1001 ///
1002 /// Indicates what types of events cause the watchpoint to fire. Used by Native
1003 /// *Protocol-related classes.
FLAGS_ENUM(WatchpointKind)1004 FLAGS_ENUM(WatchpointKind){eWatchpointKindWrite = (1u << 0),
1005 eWatchpointKindRead = (1u << 1)};
1006
1007 enum GdbSignal {
1008 eGdbSignalBadAccess = 0x91,
1009 eGdbSignalBadInstruction = 0x92,
1010 eGdbSignalArithmetic = 0x93,
1011 eGdbSignalEmulation = 0x94,
1012 eGdbSignalSoftware = 0x95,
1013 eGdbSignalBreakpoint = 0x96
1014 };
1015
1016 /// Used with SBHostOS::GetLLDBPath (lldb::PathType) to find files that are
1017 /// related to LLDB on the current host machine. Most files are
1018 /// relative to LLDB or are in known locations.
1019 enum PathType {
1020 ePathTypeLLDBShlibDir, ///< The directory where the lldb.so (unix) or LLDB
1021 ///< mach-o file in LLDB.framework (MacOSX) exists
1022 ePathTypeSupportExecutableDir, ///< Find LLDB support executable directory
1023 ///< (debugserver, etc)
1024 ePathTypeHeaderDir, ///< Find LLDB header file directory
1025 ePathTypePythonDir, ///< Find Python modules (PYTHONPATH) directory
1026 ePathTypeLLDBSystemPlugins, ///< System plug-ins directory
1027 ePathTypeLLDBUserPlugins, ///< User plug-ins directory
1028 ePathTypeLLDBTempSystemDir, ///< The LLDB temp directory for this system that
1029 ///< will be cleaned up on exit
1030 ePathTypeGlobalLLDBTempSystemDir, ///< The LLDB temp directory for this
1031 ///< system, NOT cleaned up on a process
1032 ///< exit.
1033 ePathTypeClangDir ///< Find path to Clang builtin headers
1034 };
1035
1036 /// Kind of member function.
1037 ///
1038 /// Used by the type system.
1039 enum MemberFunctionKind {
1040 eMemberFunctionKindUnknown = 0, ///< Not sure what the type of this is
1041 eMemberFunctionKindConstructor, ///< A function used to create instances
1042 eMemberFunctionKindDestructor, ///< A function used to tear down existing
1043 ///< instances
1044 eMemberFunctionKindInstanceMethod, ///< A function that applies to a specific
1045 ///< instance
1046 eMemberFunctionKindStaticMethod ///< A function that applies to a type rather
1047 ///< than any instance
1048 };
1049
1050 /// String matching algorithm used by SBTarget.
1051 enum MatchType { eMatchTypeNormal, eMatchTypeRegex, eMatchTypeStartsWith };
1052
1053 /// Bitmask that describes details about a type.
FLAGS_ENUM(TypeFlags)1054 FLAGS_ENUM(TypeFlags){
1055 eTypeHasChildren = (1u << 0), eTypeHasValue = (1u << 1),
1056 eTypeIsArray = (1u << 2), eTypeIsBlock = (1u << 3),
1057 eTypeIsBuiltIn = (1u << 4), eTypeIsClass = (1u << 5),
1058 eTypeIsCPlusPlus = (1u << 6), eTypeIsEnumeration = (1u << 7),
1059 eTypeIsFuncPrototype = (1u << 8), eTypeIsMember = (1u << 9),
1060 eTypeIsObjC = (1u << 10), eTypeIsPointer = (1u << 11),
1061 eTypeIsReference = (1u << 12), eTypeIsStructUnion = (1u << 13),
1062 eTypeIsTemplate = (1u << 14), eTypeIsTypedef = (1u << 15),
1063 eTypeIsVector = (1u << 16), eTypeIsScalar = (1u << 17),
1064 eTypeIsInteger = (1u << 18), eTypeIsFloat = (1u << 19),
1065 eTypeIsComplex = (1u << 20), eTypeIsSigned = (1u << 21),
1066 eTypeInstanceIsPointer = (1u << 22)};
1067
FLAGS_ENUM(CommandFlags)1068 FLAGS_ENUM(CommandFlags){
1069 /// eCommandRequiresTarget
1070 ///
1071 /// Ensures a valid target is contained in m_exe_ctx prior to executing the
1072 /// command. If a target doesn't exist or is invalid, the command will fail
1073 /// and CommandObject::GetInvalidTargetDescription() will be returned as the
1074 /// error. CommandObject subclasses can override the virtual function for
1075 /// GetInvalidTargetDescription() to provide custom strings when needed.
1076 eCommandRequiresTarget = (1u << 0),
1077 /// eCommandRequiresProcess
1078 ///
1079 /// Ensures a valid process is contained in m_exe_ctx prior to executing the
1080 /// command. If a process doesn't exist or is invalid, the command will fail
1081 /// and CommandObject::GetInvalidProcessDescription() will be returned as
1082 /// the error. CommandObject subclasses can override the virtual function
1083 /// for GetInvalidProcessDescription() to provide custom strings when
1084 /// needed.
1085 eCommandRequiresProcess = (1u << 1),
1086 /// eCommandRequiresThread
1087 ///
1088 /// Ensures a valid thread is contained in m_exe_ctx prior to executing the
1089 /// command. If a thread doesn't exist or is invalid, the command will fail
1090 /// and CommandObject::GetInvalidThreadDescription() will be returned as the
1091 /// error. CommandObject subclasses can override the virtual function for
1092 /// GetInvalidThreadDescription() to provide custom strings when needed.
1093 eCommandRequiresThread = (1u << 2),
1094 /// eCommandRequiresFrame
1095 ///
1096 /// Ensures a valid frame is contained in m_exe_ctx prior to executing the
1097 /// command. If a frame doesn't exist or is invalid, the command will fail
1098 /// and CommandObject::GetInvalidFrameDescription() will be returned as the
1099 /// error. CommandObject subclasses can override the virtual function for
1100 /// GetInvalidFrameDescription() to provide custom strings when needed.
1101 eCommandRequiresFrame = (1u << 3),
1102 /// eCommandRequiresRegContext
1103 ///
1104 /// Ensures a valid register context (from the selected frame if there is a
1105 /// frame in m_exe_ctx, or from the selected thread from m_exe_ctx) is
1106 /// available from m_exe_ctx prior to executing the command. If a target
1107 /// doesn't exist or is invalid, the command will fail and
1108 /// CommandObject::GetInvalidRegContextDescription() will be returned as the
1109 /// error. CommandObject subclasses can override the virtual function for
1110 /// GetInvalidRegContextDescription() to provide custom strings when needed.
1111 eCommandRequiresRegContext = (1u << 4),
1112 /// eCommandTryTargetAPILock
1113 ///
1114 /// Attempts to acquire the target lock if a target is selected in the
1115 /// command interpreter. If the command object fails to acquire the API
1116 /// lock, the command will fail with an appropriate error message.
1117 eCommandTryTargetAPILock = (1u << 5),
1118 /// eCommandProcessMustBeLaunched
1119 ///
1120 /// Verifies that there is a launched process in m_exe_ctx, if there isn't,
1121 /// the command will fail with an appropriate error message.
1122 eCommandProcessMustBeLaunched = (1u << 6),
1123 /// eCommandProcessMustBePaused
1124 ///
1125 /// Verifies that there is a paused process in m_exe_ctx, if there isn't,
1126 /// the command will fail with an appropriate error message.
1127 eCommandProcessMustBePaused = (1u << 7),
1128 /// eCommandProcessMustBeTraced
1129 ///
1130 /// Verifies that the process is being traced by a Trace plug-in, if it
1131 /// isn't the command will fail with an appropriate error message.
1132 eCommandProcessMustBeTraced = (1u << 8)};
1133
1134 /// Whether a summary should cap how much data it returns to users or not.
1135 enum TypeSummaryCapping {
1136 eTypeSummaryCapped = true,
1137 eTypeSummaryUncapped = false
1138 };
1139
1140 /// The result from a command interpreter run.
1141 enum CommandInterpreterResult {
1142 /// Command interpreter finished successfully.
1143 eCommandInterpreterResultSuccess,
1144 /// Stopped because the corresponding option was set and the inferior
1145 /// crashed.
1146 eCommandInterpreterResultInferiorCrash,
1147 /// Stopped because the corresponding option was set and a command returned
1148 /// an error.
1149 eCommandInterpreterResultCommandError,
1150 /// Stopped because quit was requested.
1151 eCommandInterpreterResultQuitRequested,
1152 };
1153
1154 // Style of core file to create when calling SaveCore.
1155 enum SaveCoreStyle {
1156 eSaveCoreUnspecified = 0,
1157 eSaveCoreFull = 1,
1158 eSaveCoreDirtyOnly = 2,
1159 eSaveCoreStackOnly = 3,
1160 };
1161
1162 /// Events that might happen during a trace session.
1163 enum TraceEvent {
1164 /// Tracing was disabled for some time due to a software trigger
1165 eTraceEventDisabledSW,
1166 /// Tracing was disable for some time due to a hardware trigger
1167 eTraceEventDisabledHW,
1168 /// Event due to CPU change for a thread. This event is also fired when
1169 /// suddenly it's not possible to identify the cpu of a given thread.
1170 eTraceEventCPUChanged,
1171 /// Event due to a CPU HW clock tick
1172 eTraceEventHWClockTick,
1173 };
1174
1175 // Enum used to identify which kind of item a \a TraceCursor is pointing at
1176 enum TraceItemKind {
1177 eTraceItemKindError = 0,
1178 eTraceItemKindEvent,
1179 eTraceItemKindInstruction,
1180 };
1181
1182 } // namespace lldb
1183
1184 #endif // LLDB_LLDB_ENUMERATIONS_H
1185