1 //===-- RegisterContextPOSIX_riscv64.h --------------------------*- C++ -*-===//
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
7 //===----------------------------------------------------------------------===//
9 #ifndef LLDB_SOURCE_PLUGINS_PROCESS_UTILITY_REGISTERCONTEXTPOSIX_RISCV64_H
10 #define LLDB_SOURCE_PLUGINS_PROCESS_UTILITY_REGISTERCONTEXTPOSIX_RISCV64_H
12 #include "RegisterInfoInterface.h"
13 #include "RegisterInfoPOSIX_riscv64.h"
14 #include "lldb-riscv-register-enums.h"
15 #include "lldb/Target/RegisterContext.h"
16 #include "lldb/Utility/Log.h"
18 class RegisterContextPOSIX_riscv64
: public lldb_private::RegisterContext
{
20 RegisterContextPOSIX_riscv64(
21 lldb_private::Thread
&thread
,
22 std::unique_ptr
<RegisterInfoPOSIX_riscv64
> register_info
);
24 ~RegisterContextPOSIX_riscv64() override
;
28 void InvalidateAllRegisters() override
;
30 size_t GetRegisterCount() override
;
32 virtual size_t GetGPRSize();
34 virtual unsigned GetRegisterSize(unsigned reg
);
36 virtual unsigned GetRegisterOffset(unsigned reg
);
38 const lldb_private::RegisterInfo
*GetRegisterInfoAtIndex(size_t reg
) override
;
40 size_t GetRegisterSetCount() override
;
42 const lldb_private::RegisterSet
*GetRegisterSet(size_t set
) override
;
45 std::unique_ptr
<RegisterInfoPOSIX_riscv64
> m_register_info_up
;
47 virtual const lldb_private::RegisterInfo
*GetRegisterInfo();
49 bool IsGPR(unsigned reg
);
51 bool IsFPR(unsigned reg
);
53 size_t GetFPRSize() { return sizeof(RegisterInfoPOSIX_riscv64::FPR
); }
55 uint32_t GetRegNumFCSR() const { return fpr_fcsr_riscv
; }
57 virtual bool ReadGPR() = 0;
58 virtual bool ReadFPR() = 0;
59 virtual bool WriteGPR() = 0;
60 virtual bool WriteFPR() = 0;
63 #endif // LLDB_SOURCE_PLUGINS_PROCESS_UTILITY_REGISTERCONTEXTPOSIX_RISCV64_H