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
13#include "llvm/ADT/BitmaskEnum.h"
14#include "llvm/ADT/StringRef.h"
15#include "llvm/Support/FormatProviders.h"
16#include "llvm/Support/raw_ostream.h"
17
18namespace lldb_private {
19
20// Address Types
23 eAddressTypeFile, ///< Address is an address as found in an object or symbol
24 /// file
25 eAddressTypeLoad, ///< Address is an address as in the current target inferior
26 /// process
27 eAddressTypeHost ///< Address is an address in the process that is running
28 /// this code
29};
30
31// Address Class
32//
33// A way of classifying an address used for disassembling and setting
34// breakpoints. Many object files can track exactly what parts of their object
35// files are code, data and other information. This is of course above and
36// beyond just looking at the section types. For example, code might contain PC
37// relative data and the object file might be able to tell us that an address
38// in code is data.
48
49// Votes - Need a tri-state, yes, no, no opinion...
50enum Vote { eVoteNo = -1, eVoteNoOpinion = 0, eVoteYes = 1 };
51
60
61/// Settable state variable types.
62///
63
64// typedef enum SettableVariableType
65//{
66// eSetVarTypeInt,
67// eSetVarTypeBoolean,
68// eSetVarTypeString,
69// eSetVarTypeArray,
70// eSetVarTypeDictionary,
71// eSetVarTypeEnum,
72// eSetVarTypeNone
73//} SettableVariableType;
74
85
87 eArgRepeatPlain, // Exactly one occurrence
88 eArgRepeatOptional, // At most one occurrence, but it's optional
89 eArgRepeatPlus, // One or more occurrences
90 eArgRepeatStar, // Zero or more occurrences
91 eArgRepeatRange, // Repetition of same argument, from 1 to n
92 eArgRepeatPairPlain, // A pair of arguments that must always go together
93 // ([arg-type arg-value]), occurs exactly once
94 eArgRepeatPairOptional, // A pair that occurs at most once (optional)
95 eArgRepeatPairPlus, // One or more occurrences of a pair
96 eArgRepeatPairStar, // Zero or more occurrences of a pair
97 eArgRepeatPairRange, // A pair that repeats from 1 to n
98 eArgRepeatPairRangeOptional // A pair that repeats from 1 to n, but is
99 // optional
100};
101
108
109// LazyBool is for boolean values that need to be calculated lazily. Values
110// start off set to eLazyBoolCalculate, and then they can be calculated once
111// and set to eLazyBoolNo or eLazyBoolYes.
112//
113// eLazyBoolDontKnow is the same value as eLazyBoolCalculate but is used in
114// contexts where the calculation is always attempted, but may turn out to not
115// be possible.
122
123/// Instruction types
125 eInstructionTypeAny, // Support for any instructions at all (at least one)
126 eInstructionTypePrologueEpilogue, // All prologue and epilogue instructions
127 // that push and pop register values and
128 // modify sp/fp
129 eInstructionTypePCModifying, // Any instruction that modifies the program
130 // counter/instruction pointer
131 eInstructionTypeAll // All instructions of any kind
132
133};
134
135/// Format category entry types
142
143/// Expression execution policies
150
151// Synchronicity behavior of scripted commands
158
159// Verbosity mode of "po" output
162 // description string, if
163 // any
165 // output
166};
167
168// Loading modules from memory
170 eMemoryModuleLoadLevelMinimal, // Load sections only
171 eMemoryModuleLoadLevelPartial, // Load function bounds but no symbols
172 eMemoryModuleLoadLevelComplete, // Load sections and all symbols
173};
174
175// Behavior on fork/vfork
177 eFollowParent, // Follow parent process
178 eFollowChild, // Follow child process
179};
180
181// Result enums for when reading multiple lines from IOHandlers
182enum class LineStatus {
183 Success, // The line that was just edited if good and should be added to the
184 // lines
185 Status, // There is an error with the current line and it needs to be
186 // re-edited
187 // before it can be accepted
188 Done // Lines are complete
189};
190
191// Boolean result of running a Type Validator
192enum class TypeValidatorResult : bool { Success = true, Failure = false };
193
194// Enumerations that can be used to specify scopes types when looking up types.
195enum class CompilerContextKind : uint16_t {
198 Module = 1 << 1,
199 Namespace = 1 << 2,
201 Union = 1 << 5,
202 Function = 1 << 6,
203 Variable = 1 << 7,
204 Enum = 1 << 8,
205 Typedef = 1 << 9,
206 Builtin = 1 << 10,
207
208 Any = 1 << 15,
209 /// Match any type.
211 /// Math any declaration context.
214};
216
217// Enumerations that can be used to specify the kind of metric we're looking at
218// when collecting stats.
226
227// Enumeration that can be used to specify a log handler.
235
241
242/// Useful for callbacks whose return type indicates
243/// whether to continue iteration or short-circuit.
244enum class IterationAction {
247};
248
249/// Controls how the `show-autosuggestion` setting drives inline suggestions
250/// in the interactive command line.
252 /// Do not show any autosuggestion.
254 /// Show a suggestion sourced from previously entered commands.
256 /// Show the prefix that tab completion would insert for the current line.
258};
259
260/// Specifies the type of PCs when creating a `HistoryThread`.
261/// - `Returns` - Usually, when LLDB unwinds the stack or we retrieve a stack
262/// trace via `backtrace()` we are collecting return addresses (except for the
263/// topmost frame which is the actual PC). LLDB then maps these return
264/// addresses back to call addresses to give accurate source line annotations.
265/// - `ReturnsNoZerothFrame` - Some trace providers (e.g., libsanitizers traces)
266/// collect return addresses but prune the topmost frames, so we should skip
267/// the special treatment of frame 0.
268/// - `Calls` - Other trace providers (e.g., ASan compiler-rt runtime) already
269/// perform this mapping, so we need to prevent LLDB from doing it again.
270enum class HistoryPCType {
271 Returns, ///< PCs are return addresses, except for topmost frame.
272 ReturnsNoZerothFrame, ///< All PCs are return addresses.
273 Calls ///< PCs are call addresses.
274};
275
277 switch (K) {
279 return "Number of expr evaluation successes";
281 return "Number of expr evaluation failures";
283 return "Number of frame var successes";
285 return "Number of frame var failures";
287 return "";
288 }
289 llvm_unreachable("Statistic not registered!");
290}
291
292} // namespace lldb_private
293
294namespace llvm {
295template <> struct format_provider<lldb_private::Vote> {
296 static void format(const lldb_private::Vote &V, llvm::raw_ostream &Stream,
297 StringRef Style) {
298 switch (V) {
300 Stream << "no";
301 return;
303 Stream << "no opinion";
304 return;
306 Stream << "yes";
307 return;
308 }
309 Stream << "invalid";
310 }
311};
312}
313
318
323
324/// The hardware and native stub capabilities for a given target,
325/// for translating a user's watchpoint request into hardware
326/// capable watchpoint resources.
327FLAGS_ENUM(WatchpointHardwareFeature){
328 /// lldb will fall back to a default that assumes the target
329 /// can watch up to pointer-size power-of-2 regions, aligned to
330 /// power-of-2.
331 eWatchpointHardwareFeatureUnknown = (1u << 0),
332
333 /// Intel systems can watch 1, 2, 4, or 8 bytes (in 64-bit targets),
334 /// aligned naturally.
335 eWatchpointHardwareX86 = (1u << 1),
336
337 /// ARM systems with Byte Address Select watchpoints
338 /// can watch any consecutive series of bytes up to the
339 /// size of a pointer (4 or 8 bytes), at a pointer-size
340 /// alignment.
341 eWatchpointHardwareArmBAS = (1u << 2),
342
343 /// ARM systems with MASK watchpoints can watch any power-of-2
344 /// sized region from 8 bytes to 2 gigabytes, aligned to that
345 /// same power-of-2 alignment.
346 eWatchpointHardwareArmMASK = (1u << 3),
347};
348LLDB_MARK_AS_BITMASK_ENUM(WatchpointHardwareFeature)
349
350#endif // LLDB_LLDB_PRIVATE_ENUMERATIONS_H
A class that describes a function.
Definition Function.h:386
A class that describes an executable image and its associated object and symbol files.
Definition Module.h:91
An error handling class.
Definition Status.h:118
#define LLDB_MARK_AS_BITMASK_ENUM(Enum)
#define FLAGS_ENUM(Name)
@ DoNoSelectMostRelevantFrame
@ SelectMostRelevantFrame
A class that represents a running process on the host machine.
@ AnyDeclContext
Math any declaration context.
HistoryPCType
Specifies the type of PCs when creating a HistoryThread.
@ Returns
PCs are return addresses, except for topmost frame.
@ ReturnsNoZerothFrame
All PCs are return addresses.
ExecutionPolicy
Expression execution policies.
std::string GetStatDescription(lldb_private::StatisticKind K)
InstructionType
Instruction types.
IterationAction
Useful for callbacks whose return type indicates whether to continue iteration or short-circuit.
LLVM_ENABLE_BITMASK_ENUMS_IN_NAMESPACE()
VarSetOperationType
Settable state variable types.
@ eAddressTypeFile
Address is an address as found in an object or symbol file.
@ eAddressTypeLoad
Address is an address as in the current target inferior process.
@ eAddressTypeHost
Address is an address in the process that is running this code.
FormatCategoryItem
Format category entry types.
AutosuggestionMode
Controls how the show-autosuggestion setting drives inline suggestions in the interactive command lin...
@ eAutosuggestionTabMode
Show the prefix that tab completion would insert for the current line.
@ eAutosuggestionOn
Show a suggestion sourced from previously entered commands.
@ eAutosuggestionOff
Do not show any autosuggestion.
static void format(const lldb_private::Vote &V, llvm::raw_ostream &Stream, StringRef Style)