]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - contrib/llvm/tools/lldb/include/lldb/lldb-private-enumerations.h
Merge llvm, clang, lld, lldb, compiler-rt and libc++ r306325, and update
[FreeBSD/FreeBSD.git] / contrib / llvm / tools / lldb / include / lldb / lldb-private-enumerations.h
1 //===-- lldb-private-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_lldb_private_enumerations_h_
11 #define LLDB_lldb_private_enumerations_h_
12
13 #include "llvm/ADT/StringRef.h"
14 #include "llvm/Support/FormatProviders.h"
15 #include "llvm/Support/raw_ostream.h"
16
17 namespace lldb_private {
18
19 //----------------------------------------------------------------------
20 // Thread Step Types
21 //----------------------------------------------------------------------
22 typedef enum StepType {
23   eStepTypeNone,
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.
30 } StepType;
31
32 //----------------------------------------------------------------------
33 // Address Types
34 //----------------------------------------------------------------------
35 typedef enum AddressType {
36   eAddressTypeInvalid = 0,
37   eAddressTypeFile, ///< Address is an address as found in an object or symbol
38                     ///file
39   eAddressTypeLoad, ///< Address is an address as in the current target inferior
40                     ///process
41   eAddressTypeHost  ///< Address is an address in the process that is running
42                     ///this code
43 } AddressType;
44
45 //----------------------------------------------------------------------
46 // Votes - Need a tri-state, yes, no, no opinion...
47 //----------------------------------------------------------------------
48 typedef enum Vote { eVoteNo = -1, eVoteNoOpinion = 0, eVoteYes = 1 } Vote;
49
50 typedef enum ArchitectureType {
51   eArchTypeInvalid,
52   eArchTypeMachO,
53   eArchTypeELF,
54   eArchTypeCOFF,
55   kNumArchTypes
56 } ArchitectureType;
57
58 //----------------------------------------------------------------------
59 /// Settable state variable types.
60 ///
61 //----------------------------------------------------------------------
62
63 // typedef enum SettableVariableType
64 //{
65 //    eSetVarTypeInt,
66 //    eSetVarTypeBoolean,
67 //    eSetVarTypeString,
68 //    eSetVarTypeArray,
69 //    eSetVarTypeDictionary,
70 //    eSetVarTypeEnum,
71 //    eSetVarTypeNone
72 //} SettableVariableType;
73
74 typedef enum VarSetOperationType {
75   eVarSetOperationReplace,
76   eVarSetOperationInsertBefore,
77   eVarSetOperationInsertAfter,
78   eVarSetOperationRemove,
79   eVarSetOperationAppend,
80   eVarSetOperationClear,
81   eVarSetOperationAssign,
82   eVarSetOperationInvalid
83 } VarSetOperationType;
84
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
98                               // optional
99 } ArgumentRepetitionType;
100
101 typedef enum SortOrder {
102   eSortOrderNone,
103   eSortOrderByAddress,
104   eSortOrderByName
105 } SortOrder;
106
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,
114   eLazyBoolNo = 0,
115   eLazyBoolYes = 1
116 } LazyBool;
117
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
125                                     // modify sp/fp
126   eInstructionTypePCModifying,      // Any instruction that modifies the program
127                                     // counter/instruction pointer
128   eInstructionTypeAll               // All instructions of any kind
129
130 } InstructionType;
131
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;
147
148 //------------------------------------------------------------------
149 /// Expression execution policies
150 //------------------------------------------------------------------
151 typedef enum {
152   eExecutionPolicyOnlyWhenNeeded,
153   eExecutionPolicyNever,
154   eExecutionPolicyAlways,
155   eExecutionPolicyTopLevel // used for top-level code
156 } ExecutionPolicy;
157
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;
171
172 //----------------------------------------------------------------------
173 // Synchronicity behavior of scripted commands
174 //----------------------------------------------------------------------
175 typedef enum ScriptedCommandSynchronicity {
176   eScriptedCommandSynchronicitySynchronous,
177   eScriptedCommandSynchronicityAsynchronous,
178   eScriptedCommandSynchronicityCurrentValue // use whatever the current
179                                             // synchronicity is
180 } ScriptedCommandSynchronicity;
181
182 //----------------------------------------------------------------------
183 // Verbosity mode of "po" output
184 //----------------------------------------------------------------------
185 typedef enum LanguageRuntimeDescriptionDisplayVerbosity {
186   eLanguageRuntimeDescriptionDisplayVerbosityCompact, // only print the
187                                                       // description string, if
188                                                       // any
189   eLanguageRuntimeDescriptionDisplayVerbosityFull,    // print the full-blown
190                                                       // output
191 } LanguageRuntimeDescriptionDisplayVerbosity;
192
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;
201
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
207            // lines
208   Status,  // There is an error with the current line and it needs to be
209            // re-edited
210            // before it can be accepted
211   Done     // Lines are complete
212 };
213
214 //----------------------------------------------------------------------
215 // Boolean result of running a Type Validator
216 //----------------------------------------------------------------------
217 enum class TypeValidatorResult : bool { Success = true, Failure = false };
218
219 //----------------------------------------------------------------------
220 // Enumerations that can be used to specify scopes types when looking up
221 // types.
222 //----------------------------------------------------------------------
223 enum class CompilerContextKind {
224   Invalid = 0,
225   TranslationUnit,
226   Module,
227   Namespace,
228   Class,
229   Structure,
230   Union,
231   Function,
232   Variable,
233   Enumeration,
234   Typedef
235 };
236
237 } // namespace lldb_private
238
239 namespace llvm {
240 template <> struct format_provider<lldb_private::Vote> {
241   static void format(const lldb_private::Vote &V, llvm::raw_ostream &Stream,
242                      StringRef Style) {
243     switch (V) {
244     case lldb_private::eVoteNo:
245       Stream << "no";
246       return;
247     case lldb_private::eVoteNoOpinion:
248       Stream << "no opinion";
249       return;
250     case lldb_private::eVoteYes:
251       Stream << "yes";
252       return;
253     }
254     Stream << "invalid";
255   }
256 };
257 }
258
259 #endif // LLDB_lldb_private_enumerations_h_