1 //===-- lldb-private-enumerations.h -----------------------------*- C++ -*-===//
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
7 //===----------------------------------------------------------------------===//
9 #ifndef LLDB_lldb_private_enumerations_h_
10 #define LLDB_lldb_private_enumerations_h_
12 #include "llvm/ADT/StringRef.h"
13 #include "llvm/Support/FormatProviders.h"
14 #include "llvm/Support/raw_ostream.h"
16 namespace lldb_private {
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.
31 eAddressTypeInvalid = 0,
32 eAddressTypeFile, ///< Address is an address as found in an object or symbol
34 eAddressTypeLoad, ///< Address is an address as in the current target inferior
36 eAddressTypeHost ///< Address is an address in the process that is running
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
48 enum class AddressClass {
58 // Votes - Need a tri-state, yes, no, no opinion...
59 enum Vote { eVoteNo = -1, eVoteNoOpinion = 0, eVoteYes = 1 };
61 enum ArchitectureType {
69 /// Settable state variable types.
72 // typedef enum SettableVariableType
75 // eSetVarTypeBoolean,
78 // eSetVarTypeDictionary,
81 //} SettableVariableType;
83 enum VarSetOperationType {
84 eVarSetOperationReplace,
85 eVarSetOperationInsertBefore,
86 eVarSetOperationInsertAfter,
87 eVarSetOperationRemove,
88 eVarSetOperationAppend,
89 eVarSetOperationClear,
90 eVarSetOperationAssign,
91 eVarSetOperationInvalid
94 enum ArgumentRepetitionType {
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
110 enum SortOrder { eSortOrderNone, eSortOrderByAddress, eSortOrderByName };
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.
115 enum LazyBool { eLazyBoolCalculate = -1, eLazyBoolNo = 0, eLazyBoolYes = 1 };
117 /// Instruction types
118 enum InstructionType {
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
123 eInstructionTypePCModifying, // Any instruction that modifies the program
124 // counter/instruction pointer
125 eInstructionTypeAll // All instructions of any kind
129 /// Format category entry types
130 enum FormatCategoryItem {
131 eFormatCategoryItemSummary = 0x0001,
132 eFormatCategoryItemRegexSummary = 0x0002,
133 eFormatCategoryItemFilter = 0x0004,
134 eFormatCategoryItemRegexFilter = 0x0008,
135 eFormatCategoryItemSynth = 0x0010,
136 eFormatCategoryItemRegexSynth = 0x0020,
137 eFormatCategoryItemValue = 0x0040,
138 eFormatCategoryItemRegexValue = 0x0080,
139 eFormatCategoryItemValidator = 0x0100,
140 eFormatCategoryItemRegexValidator = 0x0200
143 /// Expression execution policies
144 enum ExecutionPolicy {
145 eExecutionPolicyOnlyWhenNeeded,
146 eExecutionPolicyNever,
147 eExecutionPolicyAlways,
148 eExecutionPolicyTopLevel // used for top-level code
151 // Ways that the FormatManager picks a particular format for a type
152 enum FormatterChoiceCriterion {
153 eFormatterChoiceCriterionDirectChoice = 0x00000000,
154 eFormatterChoiceCriterionStrippedPointerReference = 0x00000001,
155 eFormatterChoiceCriterionNavigatedTypedefs = 0x00000002,
156 eFormatterChoiceCriterionRegularExpressionSummary = 0x00000004,
157 eFormatterChoiceCriterionRegularExpressionFilter = 0x00000004,
158 eFormatterChoiceCriterionLanguagePlugin = 0x00000008,
159 eFormatterChoiceCriterionStrippedBitField = 0x00000010,
160 eFormatterChoiceCriterionWentToStaticValue = 0x00000020
163 // Synchronicity behavior of scripted commands
164 enum ScriptedCommandSynchronicity {
165 eScriptedCommandSynchronicitySynchronous,
166 eScriptedCommandSynchronicityAsynchronous,
167 eScriptedCommandSynchronicityCurrentValue // use whatever the current
171 // Verbosity mode of "po" output
172 enum LanguageRuntimeDescriptionDisplayVerbosity {
173 eLanguageRuntimeDescriptionDisplayVerbosityCompact, // only print the
174 // description string, if
176 eLanguageRuntimeDescriptionDisplayVerbosityFull, // print the full-blown
180 // Loading modules from memory
181 enum MemoryModuleLoadLevel {
182 eMemoryModuleLoadLevelMinimal, // Load sections only
183 eMemoryModuleLoadLevelPartial, // Load function bounds but no symbols
184 eMemoryModuleLoadLevelComplete, // Load sections and all symbols
187 // Result enums for when reading multiple lines from IOHandlers
188 enum class LineStatus {
189 Success, // The line that was just edited if good and should be added to the
191 Status, // There is an error with the current line and it needs to be
193 // before it can be accepted
194 Done // Lines are complete
197 // Boolean result of running a Type Validator
198 enum class TypeValidatorResult : bool { Success = true, Failure = false };
200 // Enumerations that can be used to specify scopes types when looking up types.
201 enum class CompilerContextKind {
215 // Enumerations that can be used to specify the kind of metric we're looking at
216 // when collecting stats.
218 ExpressionSuccessful = 0,
219 ExpressionFailure = 1,
226 inline std::string GetStatDescription(lldb_private::StatisticKind K) {
228 case StatisticKind::ExpressionSuccessful:
229 return "Number of expr evaluation successes";
230 case StatisticKind::ExpressionFailure:
231 return "Number of expr evaluation failures";
232 case StatisticKind::FrameVarSuccess:
233 return "Number of frame var successes";
234 case StatisticKind::FrameVarFailure:
235 return "Number of frame var failures";
236 case StatisticKind::StatisticMax:
239 llvm_unreachable("Statistic not registered!");
242 } // namespace lldb_private
245 template <> struct format_provider<lldb_private::Vote> {
246 static void format(const lldb_private::Vote &V, llvm::raw_ostream &Stream,
249 case lldb_private::eVoteNo:
252 case lldb_private::eVoteNoOpinion:
253 Stream << "no opinion";
255 case lldb_private::eVoteYes:
264 #endif // LLDB_lldb_private_enumerations_h_