Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / lldb / source / Plugins / Process / FreeBSD / NativeRegisterContextFreeBSD_mips64.h
blob0b4a508a7d5dd9036676cbf00282fe1434272df3
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 //===----------------------------------------------------------------------===//
9 #if defined(__mips64__)
11 #ifndef lldb_NativeRegisterContextFreeBSD_mips64_h
12 #define lldb_NativeRegisterContextFreeBSD_mips64_h
14 // clang-format off
15 #include <sys/types.h>
16 #include <machine/reg.h>
17 // clang-format on
19 #include "Plugins/Process/FreeBSD/NativeRegisterContextFreeBSD.h"
20 #include "Plugins/Process/Utility/RegisterContextFreeBSD_mips64.h"
22 #include <array>
23 #include <optional>
25 namespace lldb_private {
26 namespace process_freebsd {
28 class NativeProcessFreeBSD;
30 class NativeRegisterContextFreeBSD_mips64
31 : public NativeRegisterContextFreeBSD {
32 public:
33 NativeRegisterContextFreeBSD_mips64(const ArchSpec &target_arch,
34 NativeThreadProtocol &native_thread);
36 uint32_t GetRegisterSetCount() const override;
38 uint32_t GetUserRegisterCount() const override;
40 const RegisterSet *GetRegisterSet(uint32_t set_index) const override;
42 Status ReadRegister(const RegisterInfo *reg_info,
43 RegisterValue &reg_value) override;
45 Status WriteRegister(const RegisterInfo *reg_info,
46 const RegisterValue &reg_value) override;
48 Status ReadAllRegisterValues(lldb::WritableDataBufferSP &data_sp) override;
50 Status WriteAllRegisterValues(const lldb::DataBufferSP &data_sp) override;
52 llvm::Error
53 CopyHardwareWatchpointsFrom(NativeRegisterContextFreeBSD &source) override;
55 private:
56 enum RegSetKind {
57 GPRegSet,
58 FPRegSet,
60 std::array<uint8_t, sizeof(reg) + sizeof(fpreg)> m_reg_data;
62 std::optional<RegSetKind> GetSetForNativeRegNum(uint32_t reg_num) const;
64 Status ReadRegisterSet(RegSetKind set);
65 Status WriteRegisterSet(RegSetKind set);
67 RegisterContextFreeBSD_mips64 &GetRegisterInfo() const;
70 } // namespace process_freebsd
71 } // namespace lldb_private
73 #endif // #ifndef lldb_NativeRegisterContextFreeBSD_mips64_h
75 #endif // defined (__mips64__)