1 //===-- lldb-private-types.h ------------------------------------*- C++ -*-===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 #ifndef liblldb_lldb_private_types_h_
11 #define liblldb_lldb_private_types_h_
13 #if defined(__cplusplus)
15 #include "lldb/lldb-private.h"
17 namespace lldb_private
20 class ExecutionContext;
22 //----------------------------------------------------------------------
23 // Every register is described in detail including its name, alternate
24 // name (optional), encoding, size in bytes and the default display
26 //----------------------------------------------------------------------
29 const char *name; // Name of this register, can't be NULL
30 const char *alt_name; // Alternate name of this register, can be NULL
31 uint32_t byte_size; // Size in bytes of the register
32 uint32_t byte_offset; // The byte offset in the register context data where this register's value is found
33 lldb::Encoding encoding; // Encoding of the register bits
34 lldb::Format format; // Default display format
35 uint32_t kinds[lldb::kNumRegisterKinds]; // Holds all of the various register numbers for all register kinds
36 uint32_t *value_regs; // List of registers that must be terminated with LLDB_INVALID_REGNUM
37 uint32_t *invalidate_regs; // List of registers that must be invalidated when this register is modified, list must be terminated with LLDB_INVALID_REGNUM
40 //----------------------------------------------------------------------
41 // Registers are grouped into register sets
42 //----------------------------------------------------------------------
45 const char *name; // Name of this register set
46 const char *short_name; // A short name for this register set
47 size_t num_registers; // The number of registers in REGISTERS array below
48 const uint32_t *registers; // An array of register numbers in this set
54 const char *string_value;
56 } OptionEnumValueElement;
58 struct OptionValidator
60 virtual ~OptionValidator() { }
61 virtual bool IsValid(Platform &platform, const ExecutionContext &target) const = 0;
62 virtual const char * ShortConditionString() const = 0;
63 virtual const char * LongConditionString() const = 0;
66 struct OptionDefinition
68 uint32_t usage_mask; // Used to mark options that can be used together. If (1 << n & usage_mask) != 0
69 // then this option belongs to option set n.
70 bool required; // This option is required (in the current usage level)
71 const char *long_option; // Full name for this option.
72 int short_option; // Single character for this option.
73 int option_has_arg; // no_argument, required_argument or optional_argument
74 OptionValidator* validator; // If non-NULL, option is valid iff |validator->IsValid()|, otherwise always valid.
75 OptionEnumValueElement *enum_values; // If non-NULL an array of enum values.
76 uint32_t completion_type; // Cookie the option class can use to do define the argument completion.
77 lldb::CommandArgumentType argument_type; // Type of argument this option takes
78 const char *usage_text; // Full text explaining what this options does and what (if any) argument to
82 } // namespace lldb_private
84 #endif // #if defined(__cplusplus)
86 #endif // liblldb_lldb_private_types_h_