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 typedef 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 } StepType;
28 
29 // Address Types
30 typedef enum AddressType {
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 } AddressType;
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 typedef enum Vote { eVoteNo = -1, eVoteNoOpinion = 0, eVoteYes = 1 } Vote;
60 
61 typedef enum ArchitectureType {
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 
83 typedef enum VarSetOperationType {
93 
94 typedef 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
107  // optional
109 
110 typedef enum SortOrder {
114 } SortOrder;
115 
116 // LazyBool is for boolean values that need to be calculated lazily. Values
117 // start off set to eLazyBoolCalculate, and then they can be calculated once
118 // and set to eLazyBoolNo or eLazyBoolYes.
119 typedef enum LazyBool {
123 } LazyBool;
124 
125 /// Instruction types
126 typedef enum InstructionType {
127  eInstructionTypeAny, // Support for any instructions at all (at least one)
128  eInstructionTypePrologueEpilogue, // All prologue and epilogue instructions
129  // that push and pop register values and
130  // modify sp/fp
131  eInstructionTypePCModifying, // Any instruction that modifies the program
132  // counter/instruction pointer
133  eInstructionTypeAll // All instructions of any kind
134 
136 
137 /// Format category entry types
138 typedef enum FormatCategoryItem {
150 
151 /// Expression execution policies
152 typedef enum {
156  eExecutionPolicyTopLevel // used for top-level code
158 
159 // Ways that the FormatManager picks a particular format for a type
170 
171 // Synchronicity behavior of scripted commands
175  eScriptedCommandSynchronicityCurrentValue // use whatever the current
176  // synchronicity is
178 
179 // Verbosity mode of "po" output
182  // description string, if
183  // any
185  // output
187 
188 // Loading modules from memory
189 typedef enum MemoryModuleLoadLevel {
190  eMemoryModuleLoadLevelMinimal, // Load sections only
191  eMemoryModuleLoadLevelPartial, // Load function bounds but no symbols
192  eMemoryModuleLoadLevelComplete, // Load sections and all symbols
194 
195 // Result enums for when reading multiple lines from IOHandlers
196 enum class LineStatus {
197  Success, // The line that was just edited if good and should be added to the
198  // lines
199  Status, // There is an error with the current line and it needs to be
200  // re-edited
201  // before it can be accepted
202  Done // Lines are complete
203 };
204 
205 // Boolean result of running a Type Validator
206 enum class TypeValidatorResult : bool { Success = true, Failure = false };
207 
208 // Enumerations that can be used to specify scopes types when looking up types.
210  Invalid = 0,
212  Module,
213  Namespace,
214  Class,
215  Structure,
216  Union,
217  Function,
218  Variable,
219  Enumeration,
220  Typedef
221 };
222 
223 // Enumerations that can be used to specify the kind of metric we're looking at
224 // when collecting stats.
231 };
232 
233 
235  switch (K) {
237  return "Number of expr evaluation successes";
239  return "Number of expr evaluation failures";
241  return "Number of frame var successes";
243  return "Number of frame var failures";
245  return "";
246  }
247  llvm_unreachable("Statistic not registered!");
248 }
249 
250 } // namespace lldb_private
251 
252 namespace llvm {
253 template <> struct format_provider<lldb_private::Vote> {
254  static void format(const lldb_private::Vote &V, llvm::raw_ostream &Stream,
255  StringRef Style) {
256  switch (V) {
258  Stream << "no";
259  return;
261  Stream << "no opinion";
262  return;
264  Stream << "yes";
265  return;
266  }
267  Stream << "invalid";
268  }
269 };
270 }
271 
272 #endif // LLDB_lldb_private_enumerations_h_
Enumerations for broadcasting.
Definition: SBLaunchInfo.h:14
Definition: Debugger.h:71
Single step over a specified context.
Address is an address as found in an object or symbol file.
Single step one instruction.
FormatCategoryItem
Format category entry types.
Single step one instruction, stepping over.
VarSetOperationType
Settable state variable types.
Address is an address in the process that is running this code.
std::string GetStatDescription(lldb_private::StatisticKind K)
InstructionType
Instruction types.
static void format(const lldb_private::Vote &V, llvm::raw_ostream &Stream, StringRef Style)
Single step into a specified context.
A step type implemented by the script interpreter.
Single step out a specified context.
Address is an address as in the current target inferior process.
ExecutionPolicy
Expression execution policies.