Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-05-10 08:43:00

0001 //===-- lldb-private-enumerations.h -----------------------------*- C++ -*-===//
0002 //
0003 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
0004 // See https://llvm.org/LICENSE.txt for license information.
0005 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
0006 //
0007 //===----------------------------------------------------------------------===//
0008 
0009 #ifndef LLDB_LLDB_PRIVATE_ENUMERATIONS_H
0010 #define LLDB_LLDB_PRIVATE_ENUMERATIONS_H
0011 
0012 #include "lldb/lldb-enumerations.h"
0013 #include "llvm/ADT/BitmaskEnum.h"
0014 #include "llvm/ADT/StringRef.h"
0015 #include "llvm/Support/FormatProviders.h"
0016 #include "llvm/Support/raw_ostream.h"
0017 
0018 namespace lldb_private {
0019 
0020 // Thread Step Types
0021 enum StepType {
0022   eStepTypeNone,
0023   eStepTypeTrace,     ///< Single step one instruction.
0024   eStepTypeTraceOver, ///< Single step one instruction, stepping over.
0025   eStepTypeInto,      ///< Single step into a specified context.
0026   eStepTypeOver,      ///< Single step over a specified context.
0027   eStepTypeOut,       ///< Single step out a specified context.
0028   eStepTypeScripted   ///< A step type implemented by the script interpreter.
0029 };
0030 
0031 // Address Types
0032 enum AddressType {
0033   eAddressTypeInvalid = 0,
0034   eAddressTypeFile, ///< Address is an address as found in an object or symbol
0035                     /// file
0036   eAddressTypeLoad, ///< Address is an address as in the current target inferior
0037                     /// process
0038   eAddressTypeHost  ///< Address is an address in the process that is running
0039                     /// this code
0040 };
0041 
0042 // Address Class
0043 //
0044 // A way of classifying an address used for disassembling and setting
0045 // breakpoints. Many object files can track exactly what parts of their object
0046 // files are code, data and other information. This is of course above and
0047 // beyond just looking at the section types. For example, code might contain PC
0048 // relative data and the object file might be able to tell us that an address
0049 // in code is data.
0050 enum class AddressClass {
0051   eInvalid,
0052   eUnknown,
0053   eCode,
0054   eCodeAlternateISA,
0055   eData,
0056   eDebug,
0057   eRuntime
0058 };
0059 
0060 // Votes - Need a tri-state, yes, no, no opinion...
0061 enum Vote { eVoteNo = -1, eVoteNoOpinion = 0, eVoteYes = 1 };
0062 
0063 enum ArchitectureType {
0064   eArchTypeInvalid,
0065   eArchTypeMachO,
0066   eArchTypeELF,
0067   eArchTypeCOFF,
0068   eArchTypeXCOFF,
0069   kNumArchTypes
0070 };
0071 
0072 /// Settable state variable types.
0073 ///
0074 
0075 // typedef enum SettableVariableType
0076 //{
0077 //    eSetVarTypeInt,
0078 //    eSetVarTypeBoolean,
0079 //    eSetVarTypeString,
0080 //    eSetVarTypeArray,
0081 //    eSetVarTypeDictionary,
0082 //    eSetVarTypeEnum,
0083 //    eSetVarTypeNone
0084 //} SettableVariableType;
0085 
0086 enum VarSetOperationType {
0087   eVarSetOperationReplace,
0088   eVarSetOperationInsertBefore,
0089   eVarSetOperationInsertAfter,
0090   eVarSetOperationRemove,
0091   eVarSetOperationAppend,
0092   eVarSetOperationClear,
0093   eVarSetOperationAssign,
0094   eVarSetOperationInvalid
0095 };
0096 
0097 enum ArgumentRepetitionType {
0098   eArgRepeatPlain,        // Exactly one occurrence
0099   eArgRepeatOptional,     // At most one occurrence, but it's optional
0100   eArgRepeatPlus,         // One or more occurrences
0101   eArgRepeatStar,         // Zero or more occurrences
0102   eArgRepeatRange,        // Repetition of same argument, from 1 to n
0103   eArgRepeatPairPlain,    // A pair of arguments that must always go together
0104                           // ([arg-type arg-value]), occurs exactly once
0105   eArgRepeatPairOptional, // A pair that occurs at most once (optional)
0106   eArgRepeatPairPlus,     // One or more occurrences of a pair
0107   eArgRepeatPairStar,     // Zero or more occurrences of a pair
0108   eArgRepeatPairRange,    // A pair that repeats from 1 to n
0109   eArgRepeatPairRangeOptional // A pair that repeats from 1 to n, but is
0110                               // optional
0111 };
0112 
0113 enum SortOrder {
0114   eSortOrderNone,
0115   eSortOrderByAddress,
0116   eSortOrderByName,
0117   eSortOrderBySize
0118 };
0119 
0120 // LazyBool is for boolean values that need to be calculated lazily. Values
0121 // start off set to eLazyBoolCalculate, and then they can be calculated once
0122 // and set to eLazyBoolNo or eLazyBoolYes.
0123 enum LazyBool { eLazyBoolCalculate = -1, eLazyBoolNo = 0, eLazyBoolYes = 1 };
0124 
0125 /// Instruction types
0126 enum InstructionType {
0127   eInstructionTypeAny, // Support for any instructions at all (at least one)
0128   eInstructionTypePrologueEpilogue, // All prologue and epilogue instructions
0129                                     // that push and pop register values and
0130                                     // modify sp/fp
0131   eInstructionTypePCModifying,      // Any instruction that modifies the program
0132                                     // counter/instruction pointer
0133   eInstructionTypeAll               // All instructions of any kind
0134 
0135 };
0136 
0137 /// Format category entry types
0138 enum FormatCategoryItem {
0139   eFormatCategoryItemSummary = 1,
0140   eFormatCategoryItemFilter = 1 << 1,
0141   eFormatCategoryItemSynth = 1 << 2,
0142   eFormatCategoryItemFormat = 1 << 3,
0143 };
0144 
0145 /// Expression execution policies
0146 enum ExecutionPolicy {
0147   eExecutionPolicyOnlyWhenNeeded,
0148   eExecutionPolicyNever,
0149   eExecutionPolicyAlways,
0150   eExecutionPolicyTopLevel // used for top-level code
0151 };
0152 
0153 // Synchronicity behavior of scripted commands
0154 enum ScriptedCommandSynchronicity {
0155   eScriptedCommandSynchronicitySynchronous,
0156   eScriptedCommandSynchronicityAsynchronous,
0157   eScriptedCommandSynchronicityCurrentValue // use whatever the current
0158                                             // synchronicity is
0159 };
0160 
0161 // Verbosity mode of "po" output
0162 enum LanguageRuntimeDescriptionDisplayVerbosity {
0163   eLanguageRuntimeDescriptionDisplayVerbosityCompact, // only print the
0164                                                       // description string, if
0165                                                       // any
0166   eLanguageRuntimeDescriptionDisplayVerbosityFull,    // print the full-blown
0167                                                       // output
0168 };
0169 
0170 // Loading modules from memory
0171 enum MemoryModuleLoadLevel {
0172   eMemoryModuleLoadLevelMinimal,  // Load sections only
0173   eMemoryModuleLoadLevelPartial,  // Load function bounds but no symbols
0174   eMemoryModuleLoadLevelComplete, // Load sections and all symbols
0175 };
0176 
0177 // Behavior on fork/vfork
0178 enum FollowForkMode {
0179   eFollowParent, // Follow parent process
0180   eFollowChild,  // Follow child process
0181 };
0182 
0183 // Result enums for when reading multiple lines from IOHandlers
0184 enum class LineStatus {
0185   Success, // The line that was just edited if good and should be added to the
0186            // lines
0187   Status,  // There is an error with the current line and it needs to be
0188            // re-edited
0189            // before it can be accepted
0190   Done     // Lines are complete
0191 };
0192 
0193 // Boolean result of running a Type Validator
0194 enum class TypeValidatorResult : bool { Success = true, Failure = false };
0195 
0196 // Enumerations that can be used to specify scopes types when looking up types.
0197 enum class CompilerContextKind : uint16_t {
0198   Invalid = 0,
0199   TranslationUnit = 1,
0200   Module = 1 << 1,
0201   Namespace = 1 << 2,
0202   ClassOrStruct = 1 << 3,
0203   Union = 1 << 5,
0204   Function = 1 << 6,
0205   Variable = 1 << 7,
0206   Enum = 1 << 8,
0207   Typedef = 1 << 9,
0208   Builtin = 1 << 10,
0209 
0210   Any = 1 << 15,
0211   /// Match any type.
0212   AnyType = Any | ClassOrStruct | Union | Enum | Typedef | Builtin,
0213   /// Math any declaration context.
0214   AnyDeclContext = Any | Namespace | ClassOrStruct | Union | Enum | Function,
0215   LLVM_MARK_AS_BITMASK_ENUM(/*LargestValue=*/AnyDeclContext),
0216 };
0217 LLVM_ENABLE_BITMASK_ENUMS_IN_NAMESPACE();
0218 
0219 // Enumerations that can be used to specify the kind of metric we're looking at
0220 // when collecting stats.
0221 enum StatisticKind {
0222   ExpressionSuccessful = 0,
0223   ExpressionFailure = 1,
0224   FrameVarSuccess = 2,
0225   FrameVarFailure = 3,
0226   StatisticMax = 4
0227 };
0228 
0229 // Enumeration that can be used to specify a log handler.
0230 enum LogHandlerKind {
0231   eLogHandlerStream,
0232   eLogHandlerCallback,
0233   eLogHandlerCircular,
0234   eLogHandlerSystem,
0235   eLogHandlerDefault = eLogHandlerStream,
0236 };
0237 
0238 enum LoadDependentFiles {
0239   eLoadDependentsDefault,
0240   eLoadDependentsYes,
0241   eLoadDependentsNo,
0242 };
0243 
0244 /// Useful for callbacks whose return type indicates
0245 /// whether to continue iteration or short-circuit.
0246 enum class IterationAction {
0247   Continue = 0,
0248   Stop,
0249 };
0250 
0251 inline std::string GetStatDescription(lldb_private::StatisticKind K) {
0252    switch (K) {
0253    case StatisticKind::ExpressionSuccessful:
0254      return "Number of expr evaluation successes";
0255    case StatisticKind::ExpressionFailure:
0256      return "Number of expr evaluation failures";
0257    case StatisticKind::FrameVarSuccess:
0258      return "Number of frame var successes";
0259    case StatisticKind::FrameVarFailure:
0260      return "Number of frame var failures";
0261    case StatisticKind::StatisticMax:
0262      return "";
0263    }
0264    llvm_unreachable("Statistic not registered!");
0265 }
0266 
0267 } // namespace lldb_private
0268 
0269 namespace llvm {
0270 template <> struct format_provider<lldb_private::Vote> {
0271   static void format(const lldb_private::Vote &V, llvm::raw_ostream &Stream,
0272                      StringRef Style) {
0273     switch (V) {
0274     case lldb_private::eVoteNo:
0275       Stream << "no";
0276       return;
0277     case lldb_private::eVoteNoOpinion:
0278       Stream << "no opinion";
0279       return;
0280     case lldb_private::eVoteYes:
0281       Stream << "yes";
0282       return;
0283     }
0284     Stream << "invalid";
0285   }
0286 };
0287 }
0288 
0289 enum SelectMostRelevant : bool {
0290   SelectMostRelevantFrame = true,
0291   DoNoSelectMostRelevantFrame = false,
0292 };
0293 
0294 enum InterruptionControl : bool {
0295   AllowInterruption = true,
0296   DoNotAllowInterruption = false,
0297 };
0298 
0299 /// The hardware and native stub capabilities for a given target,
0300 /// for translating a user's watchpoint request into hardware
0301 /// capable watchpoint resources.
0302 FLAGS_ENUM(WatchpointHardwareFeature){
0303     /// lldb will fall back to a default that assumes the target
0304     /// can watch up to pointer-size power-of-2 regions, aligned to
0305     /// power-of-2.
0306     eWatchpointHardwareFeatureUnknown = (1u << 0),
0307 
0308     /// Intel systems can watch 1, 2, 4, or 8 bytes (in 64-bit targets),
0309     /// aligned naturally.
0310     eWatchpointHardwareX86 = (1u << 1),
0311 
0312     /// ARM systems with Byte Address Select watchpoints
0313     /// can watch any consecutive series of bytes up to the
0314     /// size of a pointer (4 or 8 bytes), at a pointer-size
0315     /// alignment.
0316     eWatchpointHardwareArmBAS = (1u << 2),
0317 
0318     /// ARM systems with MASK watchpoints can watch any power-of-2
0319     /// sized region from 8 bytes to 2 gigabytes, aligned to that
0320     /// same power-of-2 alignment.
0321     eWatchpointHardwareArmMASK = (1u << 3),
0322 };
0323 LLDB_MARK_AS_BITMASK_ENUM(WatchpointHardwareFeature)
0324 
0325 #endif // LLDB_LLDB_PRIVATE_ENUMERATIONS_H