lldb-enumerations.h revision cf0150574a0a97049efe2dce2cc0aa433705feb3
1//===-- lldb-enumerations.h -------------------------------------*- C++ -*-===// 2// 3// The LLVM Compiler Infrastructure 4// 5// This file is distributed under the University of Illinois Open Source 6// License. See LICENSE.TXT for details. 7// 8//===----------------------------------------------------------------------===// 9 10#ifndef LLDB_enumerations_h_ 11#define LLDB_enumerations_h_ 12 13#include "llvm/System/Host.h" 14 15namespace lldb { 16 17//---------------------------------------------------------------------- 18// Process and Thread States 19//---------------------------------------------------------------------- 20typedef enum StateType 21{ 22 eStateInvalid = 0, 23 eStateUnloaded, 24 eStateAttaching, 25 eStateLaunching, 26 eStateStopped, 27 eStateRunning, 28 eStateStepping, 29 eStateCrashed, 30 eStateDetached, 31 eStateExited, 32 eStateSuspended 33} StateType; 34 35//---------------------------------------------------------------------- 36// Thread Step Types 37//---------------------------------------------------------------------- 38typedef enum StepType 39{ 40 eStepTypeNone, 41 eStepTypeTrace, ///< Single step one instruction. 42 eStepTypeTraceOver, ///< Single step one instruction, stepping over. 43 eStepTypeInto, ///< Single step into a specified context. 44 eStepTypeOver, ///< Single step over a specified context. 45 eStepTypeOut ///< Single step out a specified context. 46} StepType; 47 48//---------------------------------------------------------------------- 49// Thread Run Modes 50//---------------------------------------------------------------------- 51typedef enum RunMode { 52 eOnlyThisThread, 53 eAllThreads, 54 eOnlyDuringStepping 55} RunMode; 56 57//---------------------------------------------------------------------- 58// Address Types 59//---------------------------------------------------------------------- 60typedef enum AddressType 61{ 62 eAddressTypeInvalid = 0, 63 eAddressTypeFile, ///< Address is an address as found in an object or symbol file 64 eAddressTypeLoad, ///< Address is an address as in the current target inferior process 65 eAddressTypeHost ///< Address is an address in the process that is running this code 66} AddressType; 67 68//---------------------------------------------------------------------- 69// Byte ordering definitions 70//---------------------------------------------------------------------- 71typedef enum ByteOrder 72{ 73 eByteOrderInvalid = 0, 74 eByteOrderLittle = 1234, 75 eByteOrderBig = 4321, 76 eByteOrderPDP = 3412 77} ByteOrder; 78 79inline ByteOrder getHostByteOrder() { 80 if (llvm::sys::isLittleEndianHost()) 81 return eByteOrderLittle; 82 return eByteOrderBig; 83} 84 85// FIXME: Replace uses of eByteOrderHost with getHostByteOrder()! 86#define eByteOrderHost getHostByteOrder() 87 88//---------------------------------------------------------------------- 89// Register encoding definitions 90//---------------------------------------------------------------------- 91typedef enum Encoding 92{ 93 eEncodingInvalid = 0, 94 eEncodingUint, // unsigned integer 95 eEncodingSint, // signed integer 96 eEncodingIEEE754, // float 97 eEncodingVector // vector registers 98} Encoding; 99 100//---------------------------------------------------------------------- 101// Display format definitions 102//---------------------------------------------------------------------- 103typedef enum Format 104{ 105 eFormatDefault = 0, 106 eFormatInvalid = 0, 107 eFormatBoolean, 108 eFormatBinary, 109 eFormatBytes, 110 eFormatBytesWithASCII, 111 eFormatChar, 112 eFormatCharPrintable, // Only printable characters, space if not printable 113 eFormatComplex, 114 eFormatCString, // NULL terminated C strings 115 eFormatDecimal, 116 eFormatEnum, 117 eFormatHex, 118 eFormatFloat, 119 eFormatOctal, 120 eFormatUnicode16, 121 eFormatUnicode32, 122 eFormatUnsigned, 123 eFormatPointer, 124 eFormatVectorOfChar, 125 eFormatVectorOfSInt8, 126 eFormatVectorOfUInt8, 127 eFormatVectorOfSInt16, 128 eFormatVectorOfUInt16, 129 eFormatVectorOfSInt32, 130 eFormatVectorOfUInt32, 131 eFormatVectorOfSInt64, 132 eFormatVectorOfUInt64, 133 eFormatVectorOfFloat32, 134 eFormatVectorOfFloat64, 135 eFormatVectorOfUInt128 136 137} Format; 138 139//---------------------------------------------------------------------- 140// Description levels for "void GetDescription(Stream *, DescriptionLevel)" calls 141//---------------------------------------------------------------------- 142typedef enum DescriptionLevel 143{ 144 eDescriptionLevelBrief = 0, 145 eDescriptionLevelFull, 146 eDescriptionLevelVerbose, 147 kNumDescriptionLevels 148} DescriptionLevel; 149 150//---------------------------------------------------------------------- 151// Script interpreter types 152//---------------------------------------------------------------------- 153typedef enum ScriptLanguage 154{ 155 eScriptLanguageNone, 156 eScriptLanguagePython, 157 eScriptLanguageDefault = eScriptLanguagePython 158} ScriptLanguage; 159 160//---------------------------------------------------------------------- 161// Register numbering types 162//---------------------------------------------------------------------- 163typedef enum RegisterKind 164{ 165 eRegisterKindGCC = 0, 166 eRegisterKindDWARF, 167 eRegisterKindGeneric, 168 eRegisterKindGDB, 169 kNumRegisterKinds 170} RegisterKind; 171 172//---------------------------------------------------------------------- 173// Thread stop reasons 174//---------------------------------------------------------------------- 175typedef enum StopReason 176{ 177 eStopReasonInvalid = 0, 178 eStopReasonNone, 179 eStopReasonTrace, 180 eStopReasonBreakpoint, 181 eStopReasonWatchpoint, 182 eStopReasonSignal, 183 eStopReasonException, 184 eStopReasonPlanComplete 185} StopReason; 186 187//---------------------------------------------------------------------- 188// Votes - Need a tri-state, yes, no, no opinion... 189//---------------------------------------------------------------------- 190typedef enum Vote 191{ 192 eVoteNo = -1, 193 eVoteNoOpinion = 0, 194 eVoteYes = 1 195} Vote; 196 197//---------------------------------------------------------------------- 198// Symbol types 199//---------------------------------------------------------------------- 200typedef enum SymbolType 201{ 202 eSymbolTypeAny = 0, 203 eSymbolTypeInvalid = 0, 204 eSymbolTypeAbsolute, 205 eSymbolTypeExtern, 206 eSymbolTypeCode, 207 eSymbolTypeData, 208 eSymbolTypeTrampoline, 209 eSymbolTypeRuntime, 210 eSymbolTypeException, 211 eSymbolTypeSourceFile, 212 eSymbolTypeHeaderFile, 213 eSymbolTypeObjectFile, 214 eSymbolTypeFunction, 215 eSymbolTypeFunctionEnd, 216 eSymbolTypeCommonBlock, 217 eSymbolTypeBlock, 218 eSymbolTypeStatic, 219 eSymbolTypeGlobal, 220 eSymbolTypeLocal, 221 eSymbolTypeParam, 222 eSymbolTypeVariable, 223 eSymbolTypeVariableType, 224 eSymbolTypeLineEntry, 225 eSymbolTypeLineHeader, 226 eSymbolTypeScopeBegin, 227 eSymbolTypeScopeEnd, 228 eSymbolTypeAdditional, // When symbols take more than one entry, the extra entries get this type 229 eSymbolTypeCompiler, 230 eSymbolTypeInstrumentation, 231 eSymbolTypeUndefined 232} SymbolType; 233 234 235//---------------------------------------------------------------------- 236// Command Return Status Types 237//---------------------------------------------------------------------- 238typedef enum ReturnStatus 239{ 240 eReturnStatusInvalid, 241 eReturnStatusSuccessFinishNoResult, 242 eReturnStatusSuccessFinishResult, 243 eReturnStatusSuccessContinuingNoResult, 244 eReturnStatusSuccessContinuingResult, 245 eReturnStatusStarted, 246 eReturnStatusFailed, 247 eReturnStatusQuit 248} ReturnStatus; 249 250 251//---------------------------------------------------------------------- 252// Connection Status Types 253//---------------------------------------------------------------------- 254typedef enum ConnectionStatus 255{ 256 eConnectionStatusSuccess, // Success 257 eConnectionStatusError, // Check GetError() for details 258 eConnectionStatusTimedOut, // Request timed out 259 eConnectionStatusNoConnection, // No connection 260 eConnectionStatusLostConnection // Lost connection while connected to a valid connection 261} ConnectionStatus; 262 263 264typedef enum ErrorType 265{ 266 eErrorTypeInvalid, 267 eErrorTypeGeneric, ///< Generic errors that can be any value. 268 eErrorTypeMachKernel, ///< Mach kernel error codes. 269 eErrorTypePOSIX ///< POSIX error codes. 270} ErrorType; 271 272 273typedef enum ValueType 274{ 275 eValueTypeInvalid = 0, 276 eValueTypeVariableGlobal = 1, // globals variable 277 eValueTypeVariableStatic = 2, // static variable 278 eValueTypeVariableArgument = 3, // function argument variables 279 eValueTypeVariableLocal = 4, // function local variables 280 eValueTypeRegister = 5, // stack frame register value 281 eValueTypeRegisterSet = 6 // A collection of stack frame register values 282} ValueType; 283 284//---------------------------------------------------------------------- 285// Token size/granularities for Input Readers 286//---------------------------------------------------------------------- 287 288typedef enum InputReaderGranularity 289{ 290 eInputReaderGranularityInvalid = 0, 291 eInputReaderGranularityByte, 292 eInputReaderGranularityWord, 293 eInputReaderGranularityLine, 294 eInputReaderGranularityAll 295} InputReaderGranularity; 296 297//------------------------------------------------------------------ 298/// These mask bits allow a common interface for queries that can 299/// limit the amount of information that gets parsed to only the 300/// information that is requested. These bits also can indicate what 301/// actually did get resolved during query function calls. 302/// 303/// Each definition corresponds to a one of the member variables 304/// in this class, and requests that that item be resolved, or 305/// indicates that the member did get resolved. 306//------------------------------------------------------------------ 307typedef enum SymbolContextItem 308{ 309 eSymbolContextTarget = (1 << 0), ///< Set when \a target is requested from a query, or was located in query results 310 eSymbolContextModule = (1 << 1), ///< Set when \a module is requested from a query, or was located in query results 311 eSymbolContextCompUnit = (1 << 2), ///< Set when \a comp_unit is requested from a query, or was located in query results 312 eSymbolContextFunction = (1 << 3), ///< Set when \a function is requested from a query, or was located in query results 313 eSymbolContextBlock = (1 << 4), ///< Set when the deepest \a block is requested from a query, or was located in query results 314 eSymbolContextLineEntry = (1 << 5), ///< Set when \a line_entry is requested from a query, or was located in query results 315 eSymbolContextSymbol = (1 << 6), ///< Set when \a symbol is requested from a query, or was located in query results 316 eSymbolContextEverything = ((eSymbolContextSymbol << 1) - 1) ///< Indicates to try and lookup everything up during a query. 317} SymbolContextItem; 318 319typedef enum Permissions 320{ 321 ePermissionsWritable = (1 << 0), 322 ePermissionsReadable = (1 << 1), 323 ePermissionsExecutable = (1 << 2) 324} Permissions; 325 326typedef enum SectionType 327{ 328 eSectionTypeInvalid, 329 eSectionTypeCode, 330 eSectionTypeContainer, // The section contains child sections 331 eSectionTypeData, 332 eSectionTypeDataCString, // Inlined C string data 333 eSectionTypeDataCStringPointers, // Pointers to C string data 334 eSectionTypeDataSymbolAddress, // Address of a symbol in the symbol table 335 eSectionTypeData4, 336 eSectionTypeData8, 337 eSectionTypeData16, 338 eSectionTypeDataPointers, 339 eSectionTypeDebug, 340 eSectionTypeZeroFill, 341 eSectionTypeDataObjCMessageRefs, // Pointer to function pointer + selector 342 eSectionTypeDataObjCCFStrings, // Objective C const CFString/NSString objects 343 eSectionTypeOther 344 345} SectionType; 346 347 348typedef enum InputReaderAction 349{ 350 eInputReaderActivate, // reader is newly pushed onto the reader stack 351 eInputReaderReactivate, // reader is on top of the stack again after another reader was popped off 352 eInputReaderDeactivate, // another reader was pushed on the stack 353 eInputReaderGotToken, // reader got one of its tokens (granularity) 354 eInputReaderDone // reader was just popped off the stack and is done 355} InputReaderAction; 356 357 358typedef enum ArchitectureType 359{ 360 eArchTypeInvalid, 361 eArchTypeMachO, 362 eArchTypeELF, 363 kNumArchTypes 364} ArchitectureType; 365 366} // namespace lldb 367 368 369#endif // LLDB_enumerations_h_ 370