lldb-private-enumerations.h revision 321369
1254721Semaste//===-- lldb-private-enumerations.h -----------------------------*- C++ -*-===//
2254721Semaste//
3254721Semaste//                     The LLVM Compiler Infrastructure
4254721Semaste//
5254721Semaste// This file is distributed under the University of Illinois Open Source
6254721Semaste// License. See LICENSE.TXT for details.
7254721Semaste//
8254721Semaste//===----------------------------------------------------------------------===//
9254721Semaste
10254721Semaste#ifndef LLDB_lldb_private_enumerations_h_
11254721Semaste#define LLDB_lldb_private_enumerations_h_
12254721Semaste
13321369Sdim#include "llvm/ADT/StringRef.h"
14321369Sdim#include "llvm/Support/FormatProviders.h"
15321369Sdim#include "llvm/Support/raw_ostream.h"
16321369Sdim
17254721Semastenamespace lldb_private {
18254721Semaste
19254721Semaste//----------------------------------------------------------------------
20254721Semaste// Thread Step Types
21254721Semaste//----------------------------------------------------------------------
22314564Sdimtypedef enum StepType {
23314564Sdim  eStepTypeNone,
24314564Sdim  eStepTypeTrace,     ///< Single step one instruction.
25314564Sdim  eStepTypeTraceOver, ///< Single step one instruction, stepping over.
26314564Sdim  eStepTypeInto,      ///< Single step into a specified context.
27314564Sdim  eStepTypeOver,      ///< Single step over a specified context.
28314564Sdim  eStepTypeOut,       ///< Single step out a specified context.
29314564Sdim  eStepTypeScripted   ///< A step type implemented by the script interpreter.
30254721Semaste} StepType;
31254721Semaste
32254721Semaste//----------------------------------------------------------------------
33254721Semaste// Address Types
34254721Semaste//----------------------------------------------------------------------
35314564Sdimtypedef enum AddressType {
36314564Sdim  eAddressTypeInvalid = 0,
37314564Sdim  eAddressTypeFile, ///< Address is an address as found in an object or symbol
38314564Sdim                    ///file
39314564Sdim  eAddressTypeLoad, ///< Address is an address as in the current target inferior
40314564Sdim                    ///process
41314564Sdim  eAddressTypeHost  ///< Address is an address in the process that is running
42314564Sdim                    ///this code
43254721Semaste} AddressType;
44254721Semaste
45254721Semaste//----------------------------------------------------------------------
46254721Semaste// Votes - Need a tri-state, yes, no, no opinion...
47254721Semaste//----------------------------------------------------------------------
48314564Sdimtypedef enum Vote { eVoteNo = -1, eVoteNoOpinion = 0, eVoteYes = 1 } Vote;
49254721Semaste
50314564Sdimtypedef enum ArchitectureType {
51314564Sdim  eArchTypeInvalid,
52314564Sdim  eArchTypeMachO,
53314564Sdim  eArchTypeELF,
54314564Sdim  eArchTypeCOFF,
55314564Sdim  kNumArchTypes
56254721Semaste} ArchitectureType;
57254721Semaste
58254721Semaste//----------------------------------------------------------------------
59254721Semaste/// Settable state variable types.
60254721Semaste///
61254721Semaste//----------------------------------------------------------------------
62254721Semaste
63314564Sdim// typedef enum SettableVariableType
64254721Semaste//{
65254721Semaste//    eSetVarTypeInt,
66254721Semaste//    eSetVarTypeBoolean,
67254721Semaste//    eSetVarTypeString,
68254721Semaste//    eSetVarTypeArray,
69254721Semaste//    eSetVarTypeDictionary,
70254721Semaste//    eSetVarTypeEnum,
71254721Semaste//    eSetVarTypeNone
72254721Semaste//} SettableVariableType;
73254721Semaste
74314564Sdimtypedef enum VarSetOperationType {
75314564Sdim  eVarSetOperationReplace,
76314564Sdim  eVarSetOperationInsertBefore,
77314564Sdim  eVarSetOperationInsertAfter,
78314564Sdim  eVarSetOperationRemove,
79314564Sdim  eVarSetOperationAppend,
80314564Sdim  eVarSetOperationClear,
81314564Sdim  eVarSetOperationAssign,
82314564Sdim  eVarSetOperationInvalid
83254721Semaste} VarSetOperationType;
84254721Semaste
85314564Sdimtypedef enum ArgumentRepetitionType {
86314564Sdim  eArgRepeatPlain,        // Exactly one occurrence
87314564Sdim  eArgRepeatOptional,     // At most one occurrence, but it's optional
88314564Sdim  eArgRepeatPlus,         // One or more occurrences
89314564Sdim  eArgRepeatStar,         // Zero or more occurrences
90314564Sdim  eArgRepeatRange,        // Repetition of same argument, from 1 to n
91314564Sdim  eArgRepeatPairPlain,    // A pair of arguments that must always go together
92314564Sdim                          // ([arg-type arg-value]), occurs exactly once
93314564Sdim  eArgRepeatPairOptional, // A pair that occurs at most once (optional)
94314564Sdim  eArgRepeatPairPlus,     // One or more occurrences of a pair
95314564Sdim  eArgRepeatPairStar,     // Zero or more occurrences of a pair
96314564Sdim  eArgRepeatPairRange,    // A pair that repeats from 1 to n
97314564Sdim  eArgRepeatPairRangeOptional // A pair that repeats from 1 to n, but is
98314564Sdim                              // optional
99254721Semaste} ArgumentRepetitionType;
100254721Semaste
101314564Sdimtypedef enum SortOrder {
102314564Sdim  eSortOrderNone,
103314564Sdim  eSortOrderByAddress,
104314564Sdim  eSortOrderByName
105254721Semaste} SortOrder;
106254721Semaste
107254721Semaste//----------------------------------------------------------------------
108254721Semaste// LazyBool is for boolean values that need to be calculated lazily.
109254721Semaste// Values start off set to eLazyBoolCalculate, and then they can be
110254721Semaste// calculated once and set to eLazyBoolNo or eLazyBoolYes.
111254721Semaste//----------------------------------------------------------------------
112254721Semastetypedef enum LazyBool {
113314564Sdim  eLazyBoolCalculate = -1,
114314564Sdim  eLazyBoolNo = 0,
115314564Sdim  eLazyBoolYes = 1
116254721Semaste} LazyBool;
117254721Semaste
118254721Semaste//------------------------------------------------------------------
119254721Semaste/// Instruction types
120314564Sdim//------------------------------------------------------------------
121314564Sdimtypedef enum InstructionType {
122314564Sdim  eInstructionTypeAny, // Support for any instructions at all (at least one)
123314564Sdim  eInstructionTypePrologueEpilogue, // All prologue and epilogue instructions
124314564Sdim                                    // that push and pop register values and
125314564Sdim                                    // modify sp/fp
126314564Sdim  eInstructionTypePCModifying,      // Any instruction that modifies the program
127314564Sdim                                    // counter/instruction pointer
128314564Sdim  eInstructionTypeAll               // All instructions of any kind
129254721Semaste
130314564Sdim} InstructionType;
131314564Sdim
132254721Semaste//------------------------------------------------------------------
133254721Semaste/// Format category entry types
134314564Sdim//------------------------------------------------------------------
135314564Sdimtypedef enum FormatCategoryItem {
136314564Sdim  eFormatCategoryItemSummary = 0x0001,
137314564Sdim  eFormatCategoryItemRegexSummary = 0x0002,
138314564Sdim  eFormatCategoryItemFilter = 0x0004,
139314564Sdim  eFormatCategoryItemRegexFilter = 0x0008,
140314564Sdim  eFormatCategoryItemSynth = 0x0010,
141314564Sdim  eFormatCategoryItemRegexSynth = 0x0020,
142314564Sdim  eFormatCategoryItemValue = 0x0040,
143314564Sdim  eFormatCategoryItemRegexValue = 0x0080,
144314564Sdim  eFormatCategoryItemValidator = 0x0100,
145314564Sdim  eFormatCategoryItemRegexValidator = 0x0200
146254721Semaste} FormatCategoryItem;
147254721Semaste
148254721Semaste//------------------------------------------------------------------
149254721Semaste/// Expression execution policies
150309124Sdim//------------------------------------------------------------------
151254721Semastetypedef enum {
152314564Sdim  eExecutionPolicyOnlyWhenNeeded,
153314564Sdim  eExecutionPolicyNever,
154314564Sdim  eExecutionPolicyAlways,
155314564Sdim  eExecutionPolicyTopLevel // used for top-level code
156254721Semaste} ExecutionPolicy;
157254721Semaste
158254721Semaste//----------------------------------------------------------------------
159254721Semaste// Ways that the FormatManager picks a particular format for a type
160254721Semaste//----------------------------------------------------------------------
161314564Sdimtypedef enum FormatterChoiceCriterion {
162314564Sdim  eFormatterChoiceCriterionDirectChoice = 0x00000000,
163314564Sdim  eFormatterChoiceCriterionStrippedPointerReference = 0x00000001,
164314564Sdim  eFormatterChoiceCriterionNavigatedTypedefs = 0x00000002,
165314564Sdim  eFormatterChoiceCriterionRegularExpressionSummary = 0x00000004,
166314564Sdim  eFormatterChoiceCriterionRegularExpressionFilter = 0x00000004,
167314564Sdim  eFormatterChoiceCriterionLanguagePlugin = 0x00000008,
168314564Sdim  eFormatterChoiceCriterionStrippedBitField = 0x00000010,
169314564Sdim  eFormatterChoiceCriterionWentToStaticValue = 0x00000020
170254721Semaste} FormatterChoiceCriterion;
171254721Semaste
172254721Semaste//----------------------------------------------------------------------
173254721Semaste// Synchronicity behavior of scripted commands
174254721Semaste//----------------------------------------------------------------------
175314564Sdimtypedef enum ScriptedCommandSynchronicity {
176314564Sdim  eScriptedCommandSynchronicitySynchronous,
177314564Sdim  eScriptedCommandSynchronicityAsynchronous,
178314564Sdim  eScriptedCommandSynchronicityCurrentValue // use whatever the current
179314564Sdim                                            // synchronicity is
180254721Semaste} ScriptedCommandSynchronicity;
181254721Semaste
182258054Semaste//----------------------------------------------------------------------
183258054Semaste// Verbosity mode of "po" output
184258054Semaste//----------------------------------------------------------------------
185314564Sdimtypedef enum LanguageRuntimeDescriptionDisplayVerbosity {
186314564Sdim  eLanguageRuntimeDescriptionDisplayVerbosityCompact, // only print the
187314564Sdim                                                      // description string, if
188314564Sdim                                                      // any
189314564Sdim  eLanguageRuntimeDescriptionDisplayVerbosityFull,    // print the full-blown
190314564Sdim                                                      // output
191258054Semaste} LanguageRuntimeDescriptionDisplayVerbosity;
192254721Semaste
193254721Semaste//----------------------------------------------------------------------
194254721Semaste// Loading modules from memory
195254721Semaste//----------------------------------------------------------------------
196254721Semastetypedef enum MemoryModuleLoadLevel {
197314564Sdim  eMemoryModuleLoadLevelMinimal,  // Load sections only
198314564Sdim  eMemoryModuleLoadLevelPartial,  // Load function bounds but no symbols
199314564Sdim  eMemoryModuleLoadLevelComplete, // Load sections and all symbols
200254721Semaste} MemoryModuleLoadLevel;
201254721Semaste
202262528Semaste//----------------------------------------------------------------------
203262528Semaste// Result enums for when reading multiple lines from IOHandlers
204262528Semaste//----------------------------------------------------------------------
205262528Semasteenum class LineStatus {
206314564Sdim  Success, // The line that was just edited if good and should be added to the
207314564Sdim           // lines
208321369Sdim  Status,  // There is an error with the current line and it needs to be
209321369Sdim           // re-edited
210321369Sdim           // before it can be accepted
211321369Sdim  Done     // Lines are complete
212262528Semaste};
213262528Semaste
214276479Sdim//----------------------------------------------------------------------
215280031Sdim// Boolean result of running a Type Validator
216280031Sdim//----------------------------------------------------------------------
217314564Sdimenum class TypeValidatorResult : bool { Success = true, Failure = false };
218296417Sdim
219296417Sdim//----------------------------------------------------------------------
220296417Sdim// Enumerations that can be used to specify scopes types when looking up
221296417Sdim// types.
222296417Sdim//----------------------------------------------------------------------
223314564Sdimenum class CompilerContextKind {
224314564Sdim  Invalid = 0,
225314564Sdim  TranslationUnit,
226314564Sdim  Module,
227314564Sdim  Namespace,
228314564Sdim  Class,
229314564Sdim  Structure,
230314564Sdim  Union,
231314564Sdim  Function,
232314564Sdim  Variable,
233314564Sdim  Enumeration,
234314564Sdim  Typedef
235296417Sdim};
236314564Sdim
237254721Semaste} // namespace lldb_private
238254721Semaste
239321369Sdimnamespace llvm {
240321369Sdimtemplate <> struct format_provider<lldb_private::Vote> {
241321369Sdim  static void format(const lldb_private::Vote &V, llvm::raw_ostream &Stream,
242321369Sdim                     StringRef Style) {
243321369Sdim    switch (V) {
244321369Sdim    case lldb_private::eVoteNo:
245321369Sdim      Stream << "no";
246321369Sdim      return;
247321369Sdim    case lldb_private::eVoteNoOpinion:
248321369Sdim      Stream << "no opinion";
249321369Sdim      return;
250321369Sdim    case lldb_private::eVoteYes:
251321369Sdim      Stream << "yes";
252321369Sdim      return;
253321369Sdim    }
254321369Sdim    Stream << "invalid";
255321369Sdim  }
256321369Sdim};
257321369Sdim}
258321369Sdim
259314564Sdim#endif // LLDB_lldb_private_enumerations_h_
260