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