blob: 8dc482c61c059ed350608bfbd8f350d8de848a7b (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
|
//===-- NativeRegisterContextOpenBSD_arm64.h --------------------*- C++ -*-===//
//
// The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
#if defined(__arm64__) || defined(__aarch64__)
#ifndef lldb_NativeRegisterContextOpenBSD_arm64_h
#define lldb_NativeRegisterContextOpenBSD_arm64_h
// clang-format off
#include <sys/types.h>
#include <machine/reg.h>
// clang-format on
#include "Plugins/Process/OpenBSD/NativeRegisterContextOpenBSD.h"
#include "Plugins/Process/Utility/lldb-arm64-register-enums.h"
namespace lldb_private {
namespace process_openbsd {
class NativeProcessOpenBSD;
class NativeRegisterContextOpenBSD_arm64 : public NativeRegisterContextOpenBSD {
public:
NativeRegisterContextOpenBSD_arm64(const ArchSpec &target_arch,
NativeThreadProtocol &native_thread);
// NativeRegisterContextOpenBSD_arm64 subclasses NativeRegisterContextOpenBSD,
// which is a subclass of NativeRegisterContextRegisterInfo, which is a
// subclass of NativeRegisterContext.
//
// NativeRegisterContextOpenBSD defines an interface for reading and writing
// registers using the system ptrace API. Subclasses of NativeRegisterContextOpenBSD
// do not need to implement any of the interface defined by NativeRegisterContextOpenBSD,
// since it is not machine dependent, but they do have to implement a bunch
// of stuff from the NativeRegisterContext. Some of this is handled by a
// generic implementation in NativeRegisterContextRegisterInfo, but most of
// but most of it has to be implemented here.
size_t GetGPRSize() override { return sizeof(m_gpr); }
size_t GetFPRSize() override { return sizeof(m_fpr); }
uint32_t GetUserRegisterCount() const override;
uint32_t GetRegisterSetCount() const override;
const RegisterSet *GetRegisterSet(uint32_t set_index) const override;
Status ReadRegister(const RegisterInfo *reg_info,
RegisterValue ®_value) override;
Status WriteRegister(const RegisterInfo *reg_info,
const RegisterValue ®_value) override;
Status ReadAllRegisterValues(lldb::DataBufferSP &data_sp) override;
Status WriteAllRegisterValues(const lldb::DataBufferSP &data_sp) override;
protected:
void *GetGPRBuffer() override { return &m_gpr; }
void *GetFPRBuffer() override { return &m_fpr; }
private:
// Private member types.
enum { GPRegSet, FPRegSet };
// Private member variables.
struct reg m_gpr;
struct fpreg m_fpr;
int GetSetForNativeRegNum(int reg_num) const;
int ReadRegisterSet(uint32_t set);
int WriteRegisterSet(uint32_t set);
};
} // namespace process_openbsd
} // namespace lldb_private
#endif // #ifndef lldb_NativeRegisterContextOpenBSD_arm64_h
#endif // defined(__arm64__) || defined(__aarch64__)
|