1 //===-- lldb-private-enumerations.h -----------------------------*- C++ -*-===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 #ifndef LLDB_lldb_private_enumerations_h_
11 #define LLDB_lldb_private_enumerations_h_
13 #include "llvm/ADT/StringRef.h"
14 #include "llvm/Support/FormatProviders.h"
15 #include "llvm/Support/raw_ostream.h"
17 namespace lldb_private {
19 //----------------------------------------------------------------------
21 //----------------------------------------------------------------------
22 typedef enum StepType {
24 eStepTypeTrace, ///< Single step one instruction.
25 eStepTypeTraceOver, ///< Single step one instruction, stepping over.
26 eStepTypeInto, ///< Single step into a specified context.
27 eStepTypeOver, ///< Single step over a specified context.
28 eStepTypeOut, ///< Single step out a specified context.
29 eStepTypeScripted ///< A step type implemented by the script interpreter.
32 //----------------------------------------------------------------------
34 //----------------------------------------------------------------------
35 typedef enum AddressType {
36 eAddressTypeInvalid = 0,
37 eAddressTypeFile, ///< Address is an address as found in an object or symbol
39 eAddressTypeLoad, ///< Address is an address as in the current target inferior
41 eAddressTypeHost ///< Address is an address in the process that is running
45 //----------------------------------------------------------------------
48 // A way of classifying an address used for disassembling and setting
49 // breakpoints. Many object files can track exactly what parts of their object
50 // files are code, data and other information. This is of course above and
51 // beyond just looking at the section types. For example, code might contain PC
52 // relative data and the object file might be able to tell us that an address
54 //----------------------------------------------------------------------
55 enum class AddressClass {
65 //----------------------------------------------------------------------
66 // Votes - Need a tri-state, yes, no, no opinion...
67 //----------------------------------------------------------------------
68 typedef enum Vote { eVoteNo = -1, eVoteNoOpinion = 0, eVoteYes = 1 } Vote;
70 typedef enum ArchitectureType {
78 //----------------------------------------------------------------------
79 /// Settable state variable types.
81 //----------------------------------------------------------------------
83 // typedef enum SettableVariableType
86 // eSetVarTypeBoolean,
89 // eSetVarTypeDictionary,
92 //} SettableVariableType;
94 typedef enum VarSetOperationType {
95 eVarSetOperationReplace,
96 eVarSetOperationInsertBefore,
97 eVarSetOperationInsertAfter,
98 eVarSetOperationRemove,
99 eVarSetOperationAppend,
100 eVarSetOperationClear,
101 eVarSetOperationAssign,
102 eVarSetOperationInvalid
103 } VarSetOperationType;
105 typedef enum ArgumentRepetitionType {
106 eArgRepeatPlain, // Exactly one occurrence
107 eArgRepeatOptional, // At most one occurrence, but it's optional
108 eArgRepeatPlus, // One or more occurrences
109 eArgRepeatStar, // Zero or more occurrences
110 eArgRepeatRange, // Repetition of same argument, from 1 to n
111 eArgRepeatPairPlain, // A pair of arguments that must always go together
112 // ([arg-type arg-value]), occurs exactly once
113 eArgRepeatPairOptional, // A pair that occurs at most once (optional)
114 eArgRepeatPairPlus, // One or more occurrences of a pair
115 eArgRepeatPairStar, // Zero or more occurrences of a pair
116 eArgRepeatPairRange, // A pair that repeats from 1 to n
117 eArgRepeatPairRangeOptional // A pair that repeats from 1 to n, but is
119 } ArgumentRepetitionType;
121 typedef enum SortOrder {
127 //----------------------------------------------------------------------
128 // LazyBool is for boolean values that need to be calculated lazily. Values
129 // start off set to eLazyBoolCalculate, and then they can be calculated once
130 // and set to eLazyBoolNo or eLazyBoolYes.
131 //----------------------------------------------------------------------
132 typedef enum LazyBool {
133 eLazyBoolCalculate = -1,
138 //------------------------------------------------------------------
139 /// Instruction types
140 //------------------------------------------------------------------
141 typedef enum InstructionType {
142 eInstructionTypeAny, // Support for any instructions at all (at least one)
143 eInstructionTypePrologueEpilogue, // All prologue and epilogue instructions
144 // that push and pop register values and
146 eInstructionTypePCModifying, // Any instruction that modifies the program
147 // counter/instruction pointer
148 eInstructionTypeAll // All instructions of any kind
152 //------------------------------------------------------------------
153 /// Format category entry types
154 //------------------------------------------------------------------
155 typedef enum FormatCategoryItem {
156 eFormatCategoryItemSummary = 0x0001,
157 eFormatCategoryItemRegexSummary = 0x0002,
158 eFormatCategoryItemFilter = 0x0004,
159 eFormatCategoryItemRegexFilter = 0x0008,
160 eFormatCategoryItemSynth = 0x0010,
161 eFormatCategoryItemRegexSynth = 0x0020,
162 eFormatCategoryItemValue = 0x0040,
163 eFormatCategoryItemRegexValue = 0x0080,
164 eFormatCategoryItemValidator = 0x0100,
165 eFormatCategoryItemRegexValidator = 0x0200
166 } FormatCategoryItem;
168 //------------------------------------------------------------------
169 /// Expression execution policies
170 //------------------------------------------------------------------
172 eExecutionPolicyOnlyWhenNeeded,
173 eExecutionPolicyNever,
174 eExecutionPolicyAlways,
175 eExecutionPolicyTopLevel // used for top-level code
178 //----------------------------------------------------------------------
179 // Ways that the FormatManager picks a particular format for a type
180 //----------------------------------------------------------------------
181 typedef enum FormatterChoiceCriterion {
182 eFormatterChoiceCriterionDirectChoice = 0x00000000,
183 eFormatterChoiceCriterionStrippedPointerReference = 0x00000001,
184 eFormatterChoiceCriterionNavigatedTypedefs = 0x00000002,
185 eFormatterChoiceCriterionRegularExpressionSummary = 0x00000004,
186 eFormatterChoiceCriterionRegularExpressionFilter = 0x00000004,
187 eFormatterChoiceCriterionLanguagePlugin = 0x00000008,
188 eFormatterChoiceCriterionStrippedBitField = 0x00000010,
189 eFormatterChoiceCriterionWentToStaticValue = 0x00000020
190 } FormatterChoiceCriterion;
192 //----------------------------------------------------------------------
193 // Synchronicity behavior of scripted commands
194 //----------------------------------------------------------------------
195 typedef enum ScriptedCommandSynchronicity {
196 eScriptedCommandSynchronicitySynchronous,
197 eScriptedCommandSynchronicityAsynchronous,
198 eScriptedCommandSynchronicityCurrentValue // use whatever the current
200 } ScriptedCommandSynchronicity;
202 //----------------------------------------------------------------------
203 // Verbosity mode of "po" output
204 //----------------------------------------------------------------------
205 typedef enum LanguageRuntimeDescriptionDisplayVerbosity {
206 eLanguageRuntimeDescriptionDisplayVerbosityCompact, // only print the
207 // description string, if
209 eLanguageRuntimeDescriptionDisplayVerbosityFull, // print the full-blown
211 } LanguageRuntimeDescriptionDisplayVerbosity;
213 //----------------------------------------------------------------------
214 // Loading modules from memory
215 //----------------------------------------------------------------------
216 typedef enum MemoryModuleLoadLevel {
217 eMemoryModuleLoadLevelMinimal, // Load sections only
218 eMemoryModuleLoadLevelPartial, // Load function bounds but no symbols
219 eMemoryModuleLoadLevelComplete, // Load sections and all symbols
220 } MemoryModuleLoadLevel;
222 //----------------------------------------------------------------------
223 // Result enums for when reading multiple lines from IOHandlers
224 //----------------------------------------------------------------------
225 enum class LineStatus {
226 Success, // The line that was just edited if good and should be added to the
228 Status, // There is an error with the current line and it needs to be
230 // before it can be accepted
231 Done // Lines are complete
234 //----------------------------------------------------------------------
235 // Boolean result of running a Type Validator
236 //----------------------------------------------------------------------
237 enum class TypeValidatorResult : bool { Success = true, Failure = false };
239 //----------------------------------------------------------------------
240 // Enumerations that can be used to specify scopes types when looking up types.
241 //----------------------------------------------------------------------
242 enum class CompilerContextKind {
256 //----------------------------------------------------------------------
257 // Enumerations that can be used to specify the kind of metric we're looking at
258 // when collecting stats.
259 //----------------------------------------------------------------------
261 ExpressionSuccessful = 0,
262 ExpressionFailure = 1,
269 inline std::string GetStatDescription(lldb_private::StatisticKind K) {
271 case StatisticKind::ExpressionSuccessful:
272 return "Number of expr evaluation successes";
273 case StatisticKind::ExpressionFailure:
274 return "Number of expr evaluation failures";
275 case StatisticKind::FrameVarSuccess:
276 return "Number of frame var successes";
277 case StatisticKind::FrameVarFailure:
278 return "Number of frame var failures";
279 case StatisticKind::StatisticMax:
282 llvm_unreachable("Statistic not registered!");
285 } // namespace lldb_private
288 template <> struct format_provider<lldb_private::Vote> {
289 static void format(const lldb_private::Vote &V, llvm::raw_ostream &Stream,
292 case lldb_private::eVoteNo:
295 case lldb_private::eVoteNoOpinion:
296 Stream << "no opinion";
298 case lldb_private::eVoteYes:
307 #endif // LLDB_lldb_private_enumerations_h_