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