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 //----------------------------------------------------------------------
46 // Votes - Need a tri-state, yes, no, no opinion...
47 //----------------------------------------------------------------------
48 typedef enum Vote { eVoteNo = -1, eVoteNoOpinion = 0, eVoteYes = 1 } Vote;
50 typedef enum ArchitectureType {
58 //----------------------------------------------------------------------
59 /// Settable state variable types.
61 //----------------------------------------------------------------------
63 // typedef enum SettableVariableType
66 // eSetVarTypeBoolean,
69 // eSetVarTypeDictionary,
72 //} SettableVariableType;
74 typedef enum VarSetOperationType {
75 eVarSetOperationReplace,
76 eVarSetOperationInsertBefore,
77 eVarSetOperationInsertAfter,
78 eVarSetOperationRemove,
79 eVarSetOperationAppend,
80 eVarSetOperationClear,
81 eVarSetOperationAssign,
82 eVarSetOperationInvalid
83 } VarSetOperationType;
85 typedef enum ArgumentRepetitionType {
86 eArgRepeatPlain, // Exactly one occurrence
87 eArgRepeatOptional, // At most one occurrence, but it's optional
88 eArgRepeatPlus, // One or more occurrences
89 eArgRepeatStar, // Zero or more occurrences
90 eArgRepeatRange, // Repetition of same argument, from 1 to n
91 eArgRepeatPairPlain, // A pair of arguments that must always go together
92 // ([arg-type arg-value]), occurs exactly once
93 eArgRepeatPairOptional, // A pair that occurs at most once (optional)
94 eArgRepeatPairPlus, // One or more occurrences of a pair
95 eArgRepeatPairStar, // Zero or more occurrences of a pair
96 eArgRepeatPairRange, // A pair that repeats from 1 to n
97 eArgRepeatPairRangeOptional // A pair that repeats from 1 to n, but is
99 } ArgumentRepetitionType;
101 typedef enum SortOrder {
107 //----------------------------------------------------------------------
108 // LazyBool is for boolean values that need to be calculated lazily.
109 // Values start off set to eLazyBoolCalculate, and then they can be
110 // calculated once and set to eLazyBoolNo or eLazyBoolYes.
111 //----------------------------------------------------------------------
112 typedef enum LazyBool {
113 eLazyBoolCalculate = -1,
118 //------------------------------------------------------------------
119 /// Instruction types
120 //------------------------------------------------------------------
121 typedef enum InstructionType {
122 eInstructionTypeAny, // Support for any instructions at all (at least one)
123 eInstructionTypePrologueEpilogue, // All prologue and epilogue instructions
124 // that push and pop register values and
126 eInstructionTypePCModifying, // Any instruction that modifies the program
127 // counter/instruction pointer
128 eInstructionTypeAll // All instructions of any kind
132 //------------------------------------------------------------------
133 /// Format category entry types
134 //------------------------------------------------------------------
135 typedef enum FormatCategoryItem {
136 eFormatCategoryItemSummary = 0x0001,
137 eFormatCategoryItemRegexSummary = 0x0002,
138 eFormatCategoryItemFilter = 0x0004,
139 eFormatCategoryItemRegexFilter = 0x0008,
140 eFormatCategoryItemSynth = 0x0010,
141 eFormatCategoryItemRegexSynth = 0x0020,
142 eFormatCategoryItemValue = 0x0040,
143 eFormatCategoryItemRegexValue = 0x0080,
144 eFormatCategoryItemValidator = 0x0100,
145 eFormatCategoryItemRegexValidator = 0x0200
146 } FormatCategoryItem;
148 //------------------------------------------------------------------
149 /// Expression execution policies
150 //------------------------------------------------------------------
152 eExecutionPolicyOnlyWhenNeeded,
153 eExecutionPolicyNever,
154 eExecutionPolicyAlways,
155 eExecutionPolicyTopLevel // used for top-level code
158 //----------------------------------------------------------------------
159 // Ways that the FormatManager picks a particular format for a type
160 //----------------------------------------------------------------------
161 typedef enum FormatterChoiceCriterion {
162 eFormatterChoiceCriterionDirectChoice = 0x00000000,
163 eFormatterChoiceCriterionStrippedPointerReference = 0x00000001,
164 eFormatterChoiceCriterionNavigatedTypedefs = 0x00000002,
165 eFormatterChoiceCriterionRegularExpressionSummary = 0x00000004,
166 eFormatterChoiceCriterionRegularExpressionFilter = 0x00000004,
167 eFormatterChoiceCriterionLanguagePlugin = 0x00000008,
168 eFormatterChoiceCriterionStrippedBitField = 0x00000010,
169 eFormatterChoiceCriterionWentToStaticValue = 0x00000020
170 } FormatterChoiceCriterion;
172 //----------------------------------------------------------------------
173 // Synchronicity behavior of scripted commands
174 //----------------------------------------------------------------------
175 typedef enum ScriptedCommandSynchronicity {
176 eScriptedCommandSynchronicitySynchronous,
177 eScriptedCommandSynchronicityAsynchronous,
178 eScriptedCommandSynchronicityCurrentValue // use whatever the current
180 } ScriptedCommandSynchronicity;
182 //----------------------------------------------------------------------
183 // Verbosity mode of "po" output
184 //----------------------------------------------------------------------
185 typedef enum LanguageRuntimeDescriptionDisplayVerbosity {
186 eLanguageRuntimeDescriptionDisplayVerbosityCompact, // only print the
187 // description string, if
189 eLanguageRuntimeDescriptionDisplayVerbosityFull, // print the full-blown
191 } LanguageRuntimeDescriptionDisplayVerbosity;
193 //----------------------------------------------------------------------
194 // Loading modules from memory
195 //----------------------------------------------------------------------
196 typedef enum MemoryModuleLoadLevel {
197 eMemoryModuleLoadLevelMinimal, // Load sections only
198 eMemoryModuleLoadLevelPartial, // Load function bounds but no symbols
199 eMemoryModuleLoadLevelComplete, // Load sections and all symbols
200 } MemoryModuleLoadLevel;
202 //----------------------------------------------------------------------
203 // Result enums for when reading multiple lines from IOHandlers
204 //----------------------------------------------------------------------
205 enum class LineStatus {
206 Success, // The line that was just edited if good and should be added to the
208 Status, // There is an error with the current line and it needs to be
210 // before it can be accepted
211 Done // Lines are complete
214 //----------------------------------------------------------------------
215 // Boolean result of running a Type Validator
216 //----------------------------------------------------------------------
217 enum class TypeValidatorResult : bool { Success = true, Failure = false };
219 //----------------------------------------------------------------------
220 // Enumerations that can be used to specify scopes types when looking up
222 //----------------------------------------------------------------------
223 enum class CompilerContextKind {
237 } // namespace lldb_private
240 template <> struct format_provider<lldb_private::Vote> {
241 static void format(const lldb_private::Vote &V, llvm::raw_ostream &Stream,
244 case lldb_private::eVoteNo:
247 case lldb_private::eVoteNoOpinion:
248 Stream << "no opinion";
250 case lldb_private::eVoteYes:
259 #endif // LLDB_lldb_private_enumerations_h_