LLDB mainline
NativeRegisterContextFreeBSD_mips64.h
Go to the documentation of this file.
1//===-- NativeRegisterContextFreeBSD_mips64.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(__mips64__)
10
11#ifndef lldb_NativeRegisterContextFreeBSD_mips64_h
12#define lldb_NativeRegisterContextFreeBSD_mips64_h
13
14// clang-format off
15#include <sys/types.h>
16#include <machine/reg.h>
17// clang-format on
18
21
22#include <array>
23#include <optional>
24
25namespace lldb_private {
26namespace process_freebsd {
27
28class NativeProcessFreeBSD;
29
30class NativeRegisterContextFreeBSD_mips64
31 : public NativeRegisterContextFreeBSD {
32public:
33 NativeRegisterContextFreeBSD_mips64(const ArchSpec &target_arch,
34 NativeThreadProtocol &native_thread);
35
36 uint32_t GetRegisterSetCount() const override;
37
38 uint32_t GetUserRegisterCount() const override;
39
40 const RegisterSet *GetRegisterSet(uint32_t set_index) const override;
41
42 Status ReadRegister(const RegisterInfo *reg_info,
43 RegisterValue &reg_value) override;
44
45 Status WriteRegister(const RegisterInfo *reg_info,
46 const RegisterValue &reg_value) override;
47
48 Status ReadAllRegisterValues(lldb::WritableDataBufferSP &data_sp) override;
49
50 Status WriteAllRegisterValues(const lldb::DataBufferSP &data_sp) override;
51
52 llvm::Error
53 CopyHardwareWatchpointsFrom(NativeRegisterContextFreeBSD &source) override;
54
55private:
56 enum RegSetKind {
57 GPRegSet,
58 FPRegSet,
59 };
60 std::array<uint8_t, sizeof(reg) + sizeof(fpreg)> m_reg_data;
61
62 std::optional<RegSetKind> GetSetForNativeRegNum(uint32_t reg_num) const;
63
64 Status ReadRegisterSet(RegSetKind set);
65 Status WriteRegisterSet(RegSetKind set);
66
67 RegisterContextFreeBSD_mips64 &GetRegisterInfo() const;
68};
69
70} // namespace process_freebsd
71} // namespace lldb_private
72
73#endif // #ifndef lldb_NativeRegisterContextFreeBSD_mips64_h
74
75#endif // defined (__mips64__)
A class that represents a running process on the host machine.
Definition: SBAttachInfo.h:14
std::shared_ptr< lldb_private::DataBuffer > DataBufferSP
Definition: lldb-forward.h:328
std::shared_ptr< lldb_private::WritableDataBuffer > WritableDataBufferSP
Definition: lldb-forward.h:329