LLDB  mainline
lldb-private-types.h
Go to the documentation of this file.
1 //===-- lldb-private-types.h ------------------------------------*- C++ -*-===//
2 //
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
6 //
7 //===----------------------------------------------------------------------===//
8 
9 #ifndef LLDB_LLDB_PRIVATE_TYPES_H
10 #define LLDB_LLDB_PRIVATE_TYPES_H
11 
12 #if defined(__cplusplus)
13 
14 #include "lldb/lldb-private.h"
15 
16 #include "llvm/ADT/ArrayRef.h"
17 
18 namespace llvm {
19 namespace sys {
20 class DynamicLibrary;
21 }
22 }
23 
24 namespace lldb_private {
25 class Platform;
26 class ExecutionContext;
27 
28 typedef llvm::sys::DynamicLibrary (*LoadPluginCallbackType)(
29  const lldb::DebuggerSP &debugger_sp, const FileSpec &spec, Status &error);
30 
31 /// Every register is described in detail including its name, alternate name
32 /// (optional), encoding, size in bytes and the default display format.
33 struct RegisterInfo {
34  /// Name of this register, can't be NULL.
35  const char *name;
36  /// Alternate name of this register, can be NULL.
37  const char *alt_name;
38  /// Size in bytes of the register.
39  uint32_t byte_size;
40  /// The byte offset in the register context data where this register's
41  /// value is found.
42  /// This is optional, and can be 0 if a particular RegisterContext does not
43  /// need to address its registers by byte offset.
44  uint32_t byte_offset;
45  /// Encoding of the register bits.
46  lldb::Encoding encoding;
47  /// Default display format.
48  lldb::Format format;
49  /// Holds all of the various register numbers for all register kinds.
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 
62  llvm::ArrayRef<uint8_t> data(const uint8_t *context_base) const {
63  return llvm::ArrayRef<uint8_t>(context_base + byte_offset, byte_size);
64  }
65 
66  llvm::MutableArrayRef<uint8_t> mutable_data(uint8_t *context_base) const {
67  return llvm::MutableArrayRef<uint8_t>(context_base + byte_offset,
68  byte_size);
69  }
70 };
71 
72 /// Registers are grouped into register sets
73 struct RegisterSet {
74  /// Name of this register set.
75  const char *name;
76  /// A short name for this register set.
77  const char *short_name;
78  /// The number of registers in REGISTERS array below.
79  size_t num_registers;
80  /// An array of register indices in this set. The values in this array are
81  /// *indices* (not register numbers) into a particular RegisterContext's
82  /// register array. For example, if eax is defined at index 4 for a
83  /// particular RegisterContext, eax would be included in this RegisterSet by
84  /// adding the value 4. Not by adding the value lldb_eax_i386.
85  const uint32_t *registers;
86 };
87 
88 struct OptionEnumValueElement {
89  int64_t value;
90  const char *string_value;
91  const char *usage;
92 };
93 
94 using OptionEnumValues = llvm::ArrayRef<OptionEnumValueElement>;
95 
96 struct OptionValidator {
97  virtual ~OptionValidator() = default;
98  virtual bool IsValid(Platform &platform,
99  const ExecutionContext &target) const = 0;
100  virtual const char *ShortConditionString() const = 0;
101  virtual const char *LongConditionString() const = 0;
102 };
103 
104 typedef struct type128 { uint64_t x[2]; } type128;
105 typedef struct type256 { uint64_t x[4]; } type256;
106 
107 } // namespace lldb_private
108 
109 #endif // #if defined(__cplusplus)
110 
111 #endif // LLDB_LLDB_PRIVATE_TYPES_H
llvm
Definition: Debugger.h:49
lldb::Format
Format
Display format definitions.
Definition: lldb-enumerations.h:155
lldb::kNumRegisterKinds
@ kNumRegisterKinds
Definition: lldb-enumerations.h:235
error
static llvm::raw_ostream & error(Stream &strm)
Definition: CommandReturnObject.cpp:17
lldb-private.h
uint32_t
lldb::Encoding
Encoding
Register encoding definitions.
Definition: lldb-enumerations.h:146
lldb_private
A class that represents a running process on the host machine.
Definition: SBCommandInterpreterRunOptions.h:16
OptionValidator
lldb_private::LineStatus::Status
@ Status