LLDB mainline
RegisterInfoPOSIX_riscv64.h
Go to the documentation of this file.
1//===-- RegisterInfoPOSIX_riscv64.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#ifndef LLDB_SOURCE_PLUGINS_PROCESS_UTILITY_REGISTERINFOPOSIX_RISCV64_H
10#define LLDB_SOURCE_PLUGINS_PROCESS_UTILITY_REGISTERINFOPOSIX_RISCV64_H
11
14#include "lldb/Utility/Flags.h"
15#include "lldb/lldb-private.h"
16#include <map>
17
20public:
21 enum { GPRegSet = 0 };
22
23 // RISC-V64 register set mask value
24 enum {
28 };
29
30 struct GPR {
31 // note: gpr[0] is pc, not x0
32 uint64_t gpr[32];
33 };
34
35 struct FPR {
36 uint64_t fpr[32];
37 uint32_t fcsr;
38 };
39
40 struct VPR {
41 // The size should be VLEN*32 in bits, but we don't have VLEN here.
42 void *vpr;
43 };
44
46 lldb_private::Flags opt_regsets);
47
48 void AddRegSetGP();
49
50 void AddRegSetFP();
51
52 size_t GetGPRSize() const override;
53
54 size_t GetFPRSize() const override;
55
56 const lldb_private::RegisterInfo *GetRegisterInfo() const override;
57
58 uint32_t GetRegisterCount() const override;
59
61 GetRegisterSet(size_t reg_set) const override;
62
63 size_t GetRegisterSetCount() const override;
64
65 size_t GetRegisterSetFromRegisterIndex(uint32_t reg_index) const override;
66
68
69 bool IsFPReg(unsigned reg) const;
70
71private:
72 std::vector<lldb_private::RegisterInfo> m_register_infos;
73
74 std::vector<lldb_private::RegisterSet> m_register_sets;
75
76 // Contains pair of [start, end] register numbers of a register set with start
77 // and end included.
78 std::map<uint32_t, std::pair<uint32_t, uint32_t>> m_per_regset_regnum_range;
79
80 // Register collections to be stored as reference for m_register_sets items
81 std::vector<uint32_t> m_fp_regnum_collection;
82
84};
85
86#endif
size_t GetRegisterSetCount() const override
std::map< uint32_t, std::pair< uint32_t, uint32_t > > m_per_regset_regnum_range
std::vector< lldb_private::RegisterInfo > m_register_infos
size_t GetRegisterSetFromRegisterIndex(uint32_t reg_index) const override
std::vector< lldb_private::RegisterSet > m_register_sets
uint32_t GetRegisterCount() const override
const lldb_private::RegisterSet * GetRegisterSet(size_t reg_set) const override
std::vector< uint32_t > m_fp_regnum_collection
const lldb_private::RegisterInfo * GetRegisterInfo() const override
An architecture specification class.
Definition: ArchSpec.h:31
A class to manage flags.
Definition: Flags.h:22
bool AnySet(ValueType mask) const
Test one or more flags.
Definition: Flags.h:90
Every register is described in detail including its name, alternate name (optional),...
Registers are grouped into register sets.