1 //===-- lldb-private-types.h ------------------------------------*- C++ -*-===//
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
7 //===----------------------------------------------------------------------===//
9 #ifndef LLDB_LLDB_PRIVATE_TYPES_H
10 #define LLDB_LLDB_PRIVATE_TYPES_H
12 #if defined(__cplusplus)
14 #include "lldb/lldb-private.h"
16 #include "llvm/ADT/ArrayRef.h"
24 namespace lldb_private {
26 class ExecutionContext;
28 typedef llvm::sys::DynamicLibrary (*LoadPluginCallbackType)(
29 const lldb::DebuggerSP &debugger_sp, const FileSpec &spec, Status &error);
31 /// Every register is described in detail including its name, alternate name
32 /// (optional), encoding, size in bytes and the default display format.
34 /// Name of this register, can't be NULL.
36 /// Alternate name of this register, can be NULL.
38 /// Size in bytes of the register.
40 /// The byte offset in the register context data where this register's
42 /// This is optional, and can be 0 if a particular RegisterContext does not
43 /// need to address its registers by byte offset.
45 /// Encoding of the register bits.
46 lldb::Encoding encoding;
47 /// Default display format.
49 /// Holds all of the various register numbers for all register kinds.
50 uint32_t kinds[lldb::kNumRegisterKinds]; //
51 /// List of registers (terminated with LLDB_INVALID_REGNUM). If this value is
52 /// not null, all registers in this list will be read first, at which point
53 /// the value for this register will be valid. For example, the value list
54 /// for ah would be eax (x86) or rax (x64).
55 uint32_t *value_regs; //
56 /// List of registers (terminated with LLDB_INVALID_REGNUM). If this value is
57 /// not null, all registers in this list will be invalidated when the value of
58 /// this register changes. For example, the invalidate list for eax would be
59 /// rax ax, ah, and al.
60 uint32_t *invalidate_regs;
61 /// A DWARF expression that when evaluated gives the byte size of this
63 const uint8_t *dynamic_size_dwarf_expr_bytes;
64 /// The length of the DWARF expression in bytes in the
65 /// dynamic_size_dwarf_expr_bytes member.
66 size_t dynamic_size_dwarf_len;
68 llvm::ArrayRef<uint8_t> data(const uint8_t *context_base) const {
69 return llvm::ArrayRef<uint8_t>(context_base + byte_offset, byte_size);
72 llvm::MutableArrayRef<uint8_t> mutable_data(uint8_t *context_base) const {
73 return llvm::MutableArrayRef<uint8_t>(context_base + byte_offset,
78 /// Registers are grouped into register sets
80 /// Name of this register set.
82 /// A short name for this register set.
83 const char *short_name;
84 /// The number of registers in REGISTERS array below.
86 /// An array of register indices in this set. The values in this array are
87 /// *indices* (not register numbers) into a particular RegisterContext's
88 /// register array. For example, if eax is defined at index 4 for a
89 /// particular RegisterContext, eax would be included in this RegisterSet by
90 /// adding the value 4. Not by adding the value lldb_eax_i386.
91 const uint32_t *registers;
94 struct OptionEnumValueElement {
96 const char *string_value;
100 using OptionEnumValues = llvm::ArrayRef<OptionEnumValueElement>;
102 struct OptionValidator {
103 virtual ~OptionValidator() {}
104 virtual bool IsValid(Platform &platform,
105 const ExecutionContext &target) const = 0;
106 virtual const char *ShortConditionString() const = 0;
107 virtual const char *LongConditionString() const = 0;
110 typedef struct type128 { uint64_t x[2]; } type128;
111 typedef struct type256 { uint64_t x[4]; } type256;
113 } // namespace lldb_private
115 #endif // #if defined(__cplusplus)
117 #endif // LLDB_LLDB_PRIVATE_TYPES_H