LLDB  mainline
NativeRegisterContextNetBSD_x86_64.h
Go to the documentation of this file.
1 //===-- NativeRegisterContextNetBSD_x86_64.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 #if defined(__i386__) || defined(__x86_64__)
10 
11 #ifndef lldb_NativeRegisterContextNetBSD_x86_64_h
12 #define lldb_NativeRegisterContextNetBSD_x86_64_h
13 
14 // clang-format off
15 #include <sys/param.h>
16 #include <sys/types.h>
17 #include <sys/ptrace.h>
18 #include <machine/reg.h>
19 // clang-format on
20 
21 #include <array>
22 
27 
28 namespace lldb_private {
29 namespace process_netbsd {
30 
31 class NativeProcessNetBSD;
32 
33 class NativeRegisterContextNetBSD_x86_64
34  : public NativeRegisterContextNetBSD,
35  public NativeRegisterContextDBReg_x86 {
36 public:
37  NativeRegisterContextNetBSD_x86_64(const ArchSpec &target_arch,
38  NativeThreadProtocol &native_thread);
39  uint32_t GetRegisterSetCount() const override;
40 
41  const RegisterSet *GetRegisterSet(uint32_t set_index) const override;
42 
43  Status ReadRegister(const RegisterInfo *reg_info,
44  RegisterValue &reg_value) override;
45 
46  Status WriteRegister(const RegisterInfo *reg_info,
47  const RegisterValue &reg_value) override;
48 
49  Status ReadAllRegisterValues(lldb::WritableDataBufferSP &data_sp) override;
50 
51  Status WriteAllRegisterValues(const lldb::DataBufferSP &data_sp) override;
52 
54  CopyHardwareWatchpointsFrom(NativeRegisterContextNetBSD &source) override;
55 
56 private:
57  // Private member types.
58  enum RegSetKind {
59  GPRegSet,
60  FPRegSet,
61  DBRegSet,
62  MaxRegularRegSet = DBRegSet,
63  YMMRegSet,
64  MPXRegSet,
65  MaxRegSet = MPXRegSet,
66  };
67 
68  // Private member variables.
69  std::array<uint8_t, sizeof(struct reg)> m_gpr;
70  std::array<uint8_t, sizeof(struct xstate)> m_xstate;
71  std::array<uint8_t, sizeof(struct dbreg)> m_dbr;
72  std::array<size_t, MaxRegularRegSet + 1> m_regset_offsets;
73 
74  llvm::Optional<RegSetKind> GetSetForNativeRegNum(uint32_t reg_num) const;
75 
76  Status ReadRegisterSet(RegSetKind set);
77  Status WriteRegisterSet(RegSetKind set);
78 
79  uint8_t *GetOffsetRegSetData(RegSetKind set, size_t reg_offset);
80 
81  struct YMMSplitPtr {
82  void *xmm;
83  void *ymm_hi;
84  };
85  llvm::Optional<YMMSplitPtr> GetYMMSplitReg(uint32_t reg);
86 };
87 
88 } // namespace process_netbsd
89 } // namespace lldb_private
90 
91 #endif // #ifndef lldb_NativeRegisterContextNetBSD_x86_64_h
92 
93 #endif // defined(__x86_64__)
dbreg
Definition: RegisterContextOpenBSD_i386.cpp:35
NativeRegisterContextNetBSD.h
set
set(option_framework FRAMEWORK) endif() if(LLDB_ENABLE_PYTHON) get_target_property(python_bindings_dir swig_wrapper_python BINARY_DIR) set(lldb_python_wrapper $
Definition: API/CMakeLists.txt:5
uint32_t
lldb-x86-register-enums.h
RegisterContext_x86.h
lldb_private
A class that represents a running process on the host machine.
Definition: SBCommandInterpreterRunOptions.h:16
Error
llvm::Error Error
Definition: UdtRecordCompleter.cpp:30
lldb_private::LineStatus::Status
@ Status
NativeRegisterContextDBReg_x86.h