LLDB  mainline
lldb-private-enumerations.h
Go to the documentation of this file.
1 //===-- lldb-private-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_PRIVATE_ENUMERATIONS_H
10 #define LLDB_LLDB_PRIVATE_ENUMERATIONS_H
11 
12 #include "llvm/ADT/StringRef.h"
13 #include "llvm/Support/FormatProviders.h"
14 #include "llvm/Support/raw_ostream.h"
15 
16 namespace lldb_private {
17 
18 // Thread Step Types
19 enum StepType {
21  eStepTypeTrace, ///< Single step one instruction.
22  eStepTypeTraceOver, ///< Single step one instruction, stepping over.
23  eStepTypeInto, ///< Single step into a specified context.
24  eStepTypeOver, ///< Single step over a specified context.
25  eStepTypeOut, ///< Single step out a specified context.
26  eStepTypeScripted ///< A step type implemented by the script interpreter.
27 };
28 
29 // Address Types
32  eAddressTypeFile, ///< Address is an address as found in an object or symbol
33  /// file
34  eAddressTypeLoad, ///< Address is an address as in the current target inferior
35  /// process
36  eAddressTypeHost ///< Address is an address in the process that is running
37  /// this code
38 };
39 
40 // Address Class
41 //
42 // A way of classifying an address used for disassembling and setting
43 // breakpoints. Many object files can track exactly what parts of their object
44 // files are code, data and other information. This is of course above and
45 // beyond just looking at the section types. For example, code might contain PC
46 // relative data and the object file might be able to tell us that an address
47 // in code is data.
48 enum class AddressClass {
49  eInvalid,
50  eUnknown,
51  eCode,
53  eData,
54  eDebug,
55  eRuntime
56 };
57 
58 // Votes - Need a tri-state, yes, no, no opinion...
59 enum Vote { eVoteNo = -1, eVoteNoOpinion = 0, eVoteYes = 1 };
60 
67 };
68 
69 /// Settable state variable types.
70 ///
71 
72 // typedef enum SettableVariableType
73 //{
74 // eSetVarTypeInt,
75 // eSetVarTypeBoolean,
76 // eSetVarTypeString,
77 // eSetVarTypeArray,
78 // eSetVarTypeDictionary,
79 // eSetVarTypeEnum,
80 // eSetVarTypeNone
81 //} SettableVariableType;
82 
92 };
93 
95  eArgRepeatPlain, // Exactly one occurrence
96  eArgRepeatOptional, // At most one occurrence, but it's optional
97  eArgRepeatPlus, // One or more occurrences
98  eArgRepeatStar, // Zero or more occurrences
99  eArgRepeatRange, // Repetition of same argument, from 1 to n
100  eArgRepeatPairPlain, // A pair of arguments that must always go together
101  // ([arg-type arg-value]), occurs exactly once
102  eArgRepeatPairOptional, // A pair that occurs at most once (optional)
103  eArgRepeatPairPlus, // One or more occurrences of a pair
104  eArgRepeatPairStar, // Zero or more occurrences of a pair
105  eArgRepeatPairRange, // A pair that repeats from 1 to n
106  eArgRepeatPairRangeOptional // A pair that repeats from 1 to n, but is
107  // optional
108 };
109 
111 
112 // LazyBool is for boolean values that need to be calculated lazily. Values
113 // start off set to eLazyBoolCalculate, and then they can be calculated once
114 // and set to eLazyBoolNo or eLazyBoolYes.
116 
117 /// Instruction types
119  eInstructionTypeAny, // Support for any instructions at all (at least one)
120  eInstructionTypePrologueEpilogue, // All prologue and epilogue instructions
121  // that push and pop register values and
122  // modify sp/fp
123  eInstructionTypePCModifying, // Any instruction that modifies the program
124  // counter/instruction pointer
125  eInstructionTypeAll // All instructions of any kind
126 
127 };
128 
129 /// Format category entry types
141 };
142 
143 /// Expression execution policies
148  eExecutionPolicyTopLevel // used for top-level code
149 };
150 
151 // Synchronicity behavior of scripted commands
155  eScriptedCommandSynchronicityCurrentValue // use whatever the current
156  // synchronicity is
157 };
158 
159 // Verbosity mode of "po" output
162  // description string, if
163  // any
165  // output
166 };
167 
168 // Loading modules from memory
170  eMemoryModuleLoadLevelMinimal, // Load sections only
171  eMemoryModuleLoadLevelPartial, // Load function bounds but no symbols
172  eMemoryModuleLoadLevelComplete, // Load sections and all symbols
173 };
174 
175 // Behavior on fork/vfork
177  eFollowParent, // Follow parent process
178  eFollowChild, // Follow child process
179 };
180 
181 // Result enums for when reading multiple lines from IOHandlers
182 enum class LineStatus {
183  Success, // The line that was just edited if good and should be added to the
184  // lines
185  Status, // There is an error with the current line and it needs to be
186  // re-edited
187  // before it can be accepted
188  Done // Lines are complete
189 };
190 
191 // Boolean result of running a Type Validator
192 enum class TypeValidatorResult : bool { Success = true, Failure = false };
193 
194 // Enumerations that can be used to specify scopes types when looking up types.
196  Invalid = 0,
197  TranslationUnit = 1,
198  Module = 1 << 1,
199  Namespace = 1 << 2,
200  Class = 1 << 3,
201  Struct = 1 << 4,
202  Union = 1 << 5,
203  Function = 1 << 6,
204  Variable = 1 << 7,
205  Enum = 1 << 8,
206  Typedef = 1 << 9,
207 
208  Any = 1 << 15,
209  /// Match 0..n nested modules.
210  AnyModule = Any | Module,
211  /// Match any type.
212  AnyType = Any | Class | Struct | Union | Enum | Typedef
213 };
214 
215 // Enumerations that can be used to specify the kind of metric we're looking at
216 // when collecting stats.
223 };
224 
225 
227  switch (K) {
229  return "Number of expr evaluation successes";
231  return "Number of expr evaluation failures";
233  return "Number of frame var successes";
235  return "Number of frame var failures";
237  return "";
238  }
239  llvm_unreachable("Statistic not registered!");
240 }
241 
242 } // namespace lldb_private
243 
244 namespace llvm {
245 template <> struct format_provider<lldb_private::Vote> {
246  static void format(const lldb_private::Vote &V, llvm::raw_ostream &Stream,
247  StringRef Style) {
248  switch (V) {
250  Stream << "no";
251  return;
253  Stream << "no opinion";
254  return;
256  Stream << "yes";
257  return;
258  }
259  Stream << "invalid";
260  }
261 };
262 }
263 
264 #endif // LLDB_LLDB_PRIVATE_ENUMERATIONS_H
lldb_private::eVarSetOperationInsertBefore
@ eVarSetOperationInsertBefore
Definition: lldb-private-enumerations.h:85
lldb_private::eArgRepeatOptional
@ eArgRepeatOptional
Definition: lldb-private-enumerations.h:96
lldb_private::AddressClass::eData
@ eData
lldb_private::eVarSetOperationReplace
@ eVarSetOperationReplace
Definition: lldb-private-enumerations.h:84
lldb_private::eSortOrderByAddress
@ eSortOrderByAddress
Definition: lldb-private-enumerations.h:110
lldb_private::eArgRepeatPairRangeOptional
@ eArgRepeatPairRangeOptional
Definition: lldb-private-enumerations.h:106
lldb_private::CompilerContextKind::Invalid
@ Invalid
lldb_private::eInstructionTypePCModifying
@ eInstructionTypePCModifying
Definition: lldb-private-enumerations.h:123
llvm
Definition: Debugger.h:49
lldb_private::MemoryModuleLoadLevel
MemoryModuleLoadLevel
Definition: lldb-private-enumerations.h:169
lldb_private::CompilerContextKind::TranslationUnit
@ TranslationUnit
lldb_private::eArchTypeCOFF
@ eArchTypeCOFF
Definition: lldb-private-enumerations.h:65
lldb_private::LanguageRuntimeDescriptionDisplayVerbosity
LanguageRuntimeDescriptionDisplayVerbosity
Definition: lldb-private-enumerations.h:160
lldb_private::eArgRepeatPlain
@ eArgRepeatPlain
Definition: lldb-private-enumerations.h:95
lldb_private::ExecutionPolicy
ExecutionPolicy
Expression execution policies.
Definition: lldb-private-enumerations.h:144
lldb_private::AddressClass
AddressClass
Definition: lldb-private-enumerations.h:48
lldb_private::eVoteYes
@ eVoteYes
Definition: lldb-private-enumerations.h:59
lldb_private::eFormatCategoryItemSummary
@ eFormatCategoryItemSummary
Definition: lldb-private-enumerations.h:131
lldb_private::AddressType
AddressType
Definition: lldb-private-enumerations.h:30
lldb_private::eLazyBoolYes
@ eLazyBoolYes
Definition: lldb-private-enumerations.h:115
lldb_private::eExecutionPolicyNever
@ eExecutionPolicyNever
Definition: lldb-private-enumerations.h:146
lldb_private::eFormatCategoryItemSynth
@ eFormatCategoryItemSynth
Definition: lldb-private-enumerations.h:135
lldb_private::eStepTypeOut
@ eStepTypeOut
Single step out a specified context.
Definition: lldb-private-enumerations.h:25
lldb_private::eAddressTypeHost
@ eAddressTypeHost
Address is an address in the process that is running this code.
Definition: lldb-private-enumerations.h:36
lldb_private::LineStatus::Done
@ Done
lldb_private::Module
Definition: Module.h:84
lldb_private::eFormatCategoryItemFilter
@ eFormatCategoryItemFilter
Definition: lldb-private-enumerations.h:133
lldb_private::CompilerContextKind::Module
@ Module
lldb_private::eFormatCategoryItemRegexFilter
@ eFormatCategoryItemRegexFilter
Definition: lldb-private-enumerations.h:134
lldb_private::eVoteNoOpinion
@ eVoteNoOpinion
Definition: lldb-private-enumerations.h:59
lldb_private::LineStatus
LineStatus
Definition: lldb-private-enumerations.h:182
lldb_private::LazyBool
LazyBool
Definition: lldb-private-enumerations.h:115
lldb_private::eExecutionPolicyAlways
@ eExecutionPolicyAlways
Definition: lldb-private-enumerations.h:147
lldb_private::CompilerContextKind::Enum
@ Enum
lldb_private::eArgRepeatPlus
@ eArgRepeatPlus
Definition: lldb-private-enumerations.h:97
lldb_private::eSortOrderNone
@ eSortOrderNone
Definition: lldb-private-enumerations.h:110
lldb_private::AddressClass::eInvalid
@ eInvalid
lldb_private::eFormatCategoryItemRegexValidator
@ eFormatCategoryItemRegexValidator
Definition: lldb-private-enumerations.h:140
lldb_private::AddressClass::eUnknown
@ eUnknown
lldb_private::eArchTypeMachO
@ eArchTypeMachO
Definition: lldb-private-enumerations.h:63
lldb_private::eInstructionTypeAll
@ eInstructionTypeAll
Definition: lldb-private-enumerations.h:125
lldb_private::eArgRepeatPairOptional
@ eArgRepeatPairOptional
Definition: lldb-private-enumerations.h:102
lldb_private::eExecutionPolicyTopLevel
@ eExecutionPolicyTopLevel
Definition: lldb-private-enumerations.h:148
lldb_private::eStepTypeScripted
@ eStepTypeScripted
A step type implemented by the script interpreter.
Definition: lldb-private-enumerations.h:26
lldb_private::TypeValidatorResult::Success
@ Success
lldb_private::VarSetOperationType
VarSetOperationType
Settable state variable types.
Definition: lldb-private-enumerations.h:83
lldb_private::Function
Definition: Function.h:413
llvm::format_provider< lldb_private::Vote >::format
static void format(const lldb_private::Vote &V, llvm::raw_ostream &Stream, StringRef Style)
Definition: lldb-private-enumerations.h:246
lldb_private::eStepTypeOver
@ eStepTypeOver
Single step over a specified context.
Definition: lldb-private-enumerations.h:24
lldb_private::eVoteNo
@ eVoteNo
Definition: lldb-private-enumerations.h:59
lldb_private::CompilerContextKind::Typedef
@ Typedef
lldb_private::AddressClass::eRuntime
@ eRuntime
lldb_private::eScriptedCommandSynchronicityAsynchronous
@ eScriptedCommandSynchronicityAsynchronous
Definition: lldb-private-enumerations.h:154
lldb_private::eAddressTypeInvalid
@ eAddressTypeInvalid
Definition: lldb-private-enumerations.h:31
lldb_private::eArgRepeatPairPlain
@ eArgRepeatPairPlain
Definition: lldb-private-enumerations.h:100
lldb_private::eStepTypeInto
@ eStepTypeInto
Single step into a specified context.
Definition: lldb-private-enumerations.h:23
lldb_private::eArgRepeatRange
@ eArgRepeatRange
Definition: lldb-private-enumerations.h:99
lldb_private::eVarSetOperationAppend
@ eVarSetOperationAppend
Definition: lldb-private-enumerations.h:88
lldb_private::CompilerContextKind::Union
@ Union
lldb_private::eArgRepeatPairPlus
@ eArgRepeatPairPlus
Definition: lldb-private-enumerations.h:103
lldb_private::ExpressionFailure
@ ExpressionFailure
Definition: lldb-private-enumerations.h:219
lldb_private::eFormatCategoryItemRegexValue
@ eFormatCategoryItemRegexValue
Definition: lldb-private-enumerations.h:138
lldb_private::eArgRepeatStar
@ eArgRepeatStar
Definition: lldb-private-enumerations.h:98
lldb_private::StatisticKind
StatisticKind
Definition: lldb-private-enumerations.h:217
string
string(SUBSTRING ${p} 10 -1 pStripped) if($
Definition: Plugins/CMakeLists.txt:40
lldb_private::eAddressTypeLoad
@ eAddressTypeLoad
Address is an address as in the current target inferior process.
Definition: lldb-private-enumerations.h:34
lldb_private::FrameVarSuccess
@ FrameVarSuccess
Definition: lldb-private-enumerations.h:220
lldb_private::eArgRepeatPairRange
@ eArgRepeatPairRange
Definition: lldb-private-enumerations.h:105
lldb_private::eScriptedCommandSynchronicitySynchronous
@ eScriptedCommandSynchronicitySynchronous
Definition: lldb-private-enumerations.h:153
lldb_private::FrameVarFailure
@ FrameVarFailure
Definition: lldb-private-enumerations.h:221
lldb_private::eMemoryModuleLoadLevelPartial
@ eMemoryModuleLoadLevelPartial
Definition: lldb-private-enumerations.h:171
lldb_private::kNumArchTypes
@ kNumArchTypes
Definition: lldb-private-enumerations.h:66
lldb_private::CompilerContextKind::AnyModule
@ AnyModule
Match 0..n nested modules.
lldb_private::CompilerContextKind::Class
@ Class
lldb_private::GetStatDescription
std::string GetStatDescription(lldb_private::StatisticKind K)
Definition: lldb-private-enumerations.h:226
lldb_private::eStepTypeTraceOver
@ eStepTypeTraceOver
Single step one instruction, stepping over.
Definition: lldb-private-enumerations.h:22
lldb_private::ArchitectureType
ArchitectureType
Definition: lldb-private-enumerations.h:61
lldb_private::ArgumentRepetitionType
ArgumentRepetitionType
Definition: lldb-private-enumerations.h:94
lldb_private::CompilerContextKind
CompilerContextKind
Definition: lldb-private-enumerations.h:195
lldb_private::StepType
StepType
Definition: lldb-private-enumerations.h:19
lldb_private::eLazyBoolNo
@ eLazyBoolNo
Definition: lldb-private-enumerations.h:115
lldb_private::StatisticMax
@ StatisticMax
Definition: lldb-private-enumerations.h:222
lldb_private::eFormatCategoryItemValidator
@ eFormatCategoryItemValidator
Definition: lldb-private-enumerations.h:139
lldb_private::eLanguageRuntimeDescriptionDisplayVerbosityFull
@ eLanguageRuntimeDescriptionDisplayVerbosityFull
Definition: lldb-private-enumerations.h:164
lldb_private::FollowForkMode
FollowForkMode
Definition: lldb-private-enumerations.h:176
lldb_private::eScriptedCommandSynchronicityCurrentValue
@ eScriptedCommandSynchronicityCurrentValue
Definition: lldb-private-enumerations.h:155
lldb_private::eMemoryModuleLoadLevelComplete
@ eMemoryModuleLoadLevelComplete
Definition: lldb-private-enumerations.h:172
lldb_private::eArchTypeELF
@ eArchTypeELF
Definition: lldb-private-enumerations.h:64
lldb_private::eMemoryModuleLoadLevelMinimal
@ eMemoryModuleLoadLevelMinimal
Definition: lldb-private-enumerations.h:170
lldb_private::eAddressTypeFile
@ eAddressTypeFile
Address is an address as found in an object or symbol file.
Definition: lldb-private-enumerations.h:32
lldb_private::eFormatCategoryItemRegexSynth
@ eFormatCategoryItemRegexSynth
Definition: lldb-private-enumerations.h:136
lldb_private::AddressClass::eCode
@ eCode
uint16_t
lldb_private::Vote
Vote
Definition: lldb-private-enumerations.h:59
lldb_private::eArchTypeInvalid
@ eArchTypeInvalid
Definition: lldb-private-enumerations.h:62
lldb_private::eVarSetOperationRemove
@ eVarSetOperationRemove
Definition: lldb-private-enumerations.h:87
lldb_private::eInstructionTypePrologueEpilogue
@ eInstructionTypePrologueEpilogue
Definition: lldb-private-enumerations.h:120
lldb_private::eExecutionPolicyOnlyWhenNeeded
@ eExecutionPolicyOnlyWhenNeeded
Definition: lldb-private-enumerations.h:145
lldb_private::CompilerContextKind::AnyType
@ AnyType
Match any type.
lldb_private::SortOrder
SortOrder
Definition: lldb-private-enumerations.h:110
lldb_private::AddressClass::eDebug
@ eDebug
lldb_private::InstructionType
InstructionType
Instruction types.
Definition: lldb-private-enumerations.h:118
lldb_private::ExpressionSuccessful
@ ExpressionSuccessful
Definition: lldb-private-enumerations.h:218
lldb_private::AddressClass::eCodeAlternateISA
@ eCodeAlternateISA
lldb_private
A class that represents a running process on the host machine.
Definition: SBCommandInterpreterRunOptions.h:16
lldb_private::eLazyBoolCalculate
@ eLazyBoolCalculate
Definition: lldb-private-enumerations.h:115
lldb_private::LineStatus::Success
@ Success
lldb_private::eFormatCategoryItemRegexSummary
@ eFormatCategoryItemRegexSummary
Definition: lldb-private-enumerations.h:132
lldb_private::eStepTypeTrace
@ eStepTypeTrace
Single step one instruction.
Definition: lldb-private-enumerations.h:21
lldb_private::TypeValidatorResult::Failure
@ Failure
lldb_private::eSortOrderByName
@ eSortOrderByName
Definition: lldb-private-enumerations.h:110
lldb_private::eFormatCategoryItemValue
@ eFormatCategoryItemValue
Definition: lldb-private-enumerations.h:137
lldb_private::eVarSetOperationInvalid
@ eVarSetOperationInvalid
Definition: lldb-private-enumerations.h:91
lldb_private::Variable
Definition: Variable.h:25
lldb_private::eFollowParent
@ eFollowParent
Definition: lldb-private-enumerations.h:177
lldb_private::CompilerContextKind::Any
@ Any
lldb_private::CompilerContextKind::Namespace
@ Namespace
lldb_private::FormatCategoryItem
FormatCategoryItem
Format category entry types.
Definition: lldb-private-enumerations.h:130
lldb_private::eLanguageRuntimeDescriptionDisplayVerbosityCompact
@ eLanguageRuntimeDescriptionDisplayVerbosityCompact
Definition: lldb-private-enumerations.h:161
lldb_private::LineStatus::Status
@ Status
lldb_private::eStepTypeNone
@ eStepTypeNone
Definition: lldb-private-enumerations.h:20
lldb_private::eInstructionTypeAny
@ eInstructionTypeAny
Definition: lldb-private-enumerations.h:119
lldb_private::TypeValidatorResult
TypeValidatorResult
Definition: lldb-private-enumerations.h:192
lldb_private::ScriptedCommandSynchronicity
ScriptedCommandSynchronicity
Definition: lldb-private-enumerations.h:152
lldb_private::eVarSetOperationClear
@ eVarSetOperationClear
Definition: lldb-private-enumerations.h:89
lldb_private::CompilerContextKind::Struct
@ Struct
lldb_private::eArgRepeatPairStar
@ eArgRepeatPairStar
Definition: lldb-private-enumerations.h:104
lldb_private::eVarSetOperationInsertAfter
@ eVarSetOperationInsertAfter
Definition: lldb-private-enumerations.h:86
lldb_private::eVarSetOperationAssign
@ eVarSetOperationAssign
Definition: lldb-private-enumerations.h:90
lldb_private::eFollowChild
@ eFollowChild
Definition: lldb-private-enumerations.h:178