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"
25 namespace lldb_private
28 class ExecutionContext;
30 typedef llvm::sys::DynamicLibrary (*LoadPluginCallbackType)(const lldb::DebuggerSP &debugger_sp,
31 const FileSpec &spec, Error &error);
33 //----------------------------------------------------------------------
34 // Every register is described in detail including its name, alternate
35 // name (optional), encoding, size in bytes and the default display
37 //----------------------------------------------------------------------
40 const char *name; // Name of this register, can't be NULL
41 const char *alt_name; // Alternate name of this register, can be NULL
42 uint32_t byte_size; // Size in bytes of the register
43 uint32_t byte_offset; // The byte offset in the register context data where this register's value is found.
44 // This is optional, and can be 0 if a particular RegisterContext does not need to
45 // address its registers by byte offset.
46 lldb::Encoding encoding; // Encoding of the register bits
47 lldb::Format format; // Default display format
48 uint32_t kinds[lldb::kNumRegisterKinds]; // Holds all of the various register numbers for all register kinds
49 uint32_t *value_regs; // List of registers (terminated with LLDB_INVALID_REGNUM). If this value is not
50 // null, all registers in this list will be read first, at which point the value
51 // for this register will be valid. For example, the value list for ah
52 // would be eax (x86) or rax (x64).
53 uint32_t *invalidate_regs; // List of registers (terminated with LLDB_INVALID_REGNUM). If this value is not
54 // null, all registers in this list will be invalidated when the value of this
55 // register changes. For example, the invalidate list for eax would be rax
57 const uint8_t *dynamic_size_dwarf_expr_bytes; // A DWARF expression that when evaluated gives
58 // the byte size of this register.
59 size_t dynamic_size_dwarf_len; // The length of the DWARF expression in bytes
60 // in the dynamic_size_dwarf_expr_bytes member.
63 //----------------------------------------------------------------------
64 // Registers are grouped into register sets
65 //----------------------------------------------------------------------
68 const char *name; // Name of this register set
69 const char *short_name; // A short name for this register set
70 size_t num_registers; // The number of registers in REGISTERS array below
71 const uint32_t *registers; // An array of register indices in this set. The values in this array are
72 // *indices* (not register numbers) into a particular RegisterContext's
73 // register array. For example, if eax is defined at index 4 for a
74 // particular RegisterContext, eax would be included in this RegisterSet
75 // by adding the value 4. Not by adding the value lldb_eax_i386.
78 struct OptionEnumValueElement
81 const char *string_value;
85 struct OptionValidator
87 virtual ~OptionValidator() { }
88 virtual bool IsValid(Platform &platform, const ExecutionContext &target) const = 0;
89 virtual const char * ShortConditionString() const = 0;
90 virtual const char * LongConditionString() const = 0;
93 struct OptionDefinition
95 uint32_t usage_mask; // Used to mark options that can be used together. If (1 << n & usage_mask) != 0
96 // then this option belongs to option set n.
97 bool required; // This option is required (in the current usage level)
98 const char *long_option; // Full name for this option.
99 int short_option; // Single character for this option.
100 int option_has_arg; // no_argument, required_argument or optional_argument
101 OptionValidator* validator; // If non-NULL, option is valid iff |validator->IsValid()|, otherwise always valid.
102 OptionEnumValueElement *enum_values; // If non-NULL an array of enum values.
103 uint32_t completion_type; // Cookie the option class can use to do define the argument completion.
104 lldb::CommandArgumentType argument_type; // Type of argument this option takes
105 const char *usage_text; // Full text explaining what this options does and what (if any) argument to
109 typedef struct type128 { uint64_t x[2]; } type128;
110 typedef struct type256 { uint64_t x[4]; } type256;
112 } // namespace lldb_private
114 #endif // #if defined(__cplusplus)
116 #endif // liblldb_lldb_private_types_h_