18#include "gdbsupport/common-defs.h"
21#include <unordered_map>
30#define STATIC_IN_GDB static
43#ifndef IN_PROCESS_AGENT
44 std::string arch_name =
"riscv";
46 if (features.
xlen == 4)
49 arch_name.append (
":rv32e");
51 arch_name.append (
":rv32i");
53 else if (features.
xlen == 8)
54 arch_name.append (
":rv64i");
55 else if (features.
xlen == 16)
56 arch_name.append (
":rv128i");
58 if (features.
flen == 4)
59 arch_name.append (
"f");
60 else if (features.
flen == 8)
61 arch_name.append (
"d");
62 else if (features.
flen == 16)
63 arch_name.append (
"q");
71 if (features.
xlen == 4)
78 else if (features.
xlen == 8)
82 if (features.
flen == 4)
84 else if (features.
flen == 8)
90 if (features.
vlen != 0)
91 error (_(
"unable to create vector feature"));
104 return features.hash ();
111 const target_desc_up,
124 return it->second.get ();
static int create_feature_riscv_32bit_cpu(struct target_desc *result, long regnum)
static int create_feature_riscv_32bit_fpu(struct target_desc *result, long regnum)
static int create_feature_riscv_64bit_cpu(struct target_desc *result, long regnum)
static int create_feature_riscv_64bit_fpu(struct target_desc *result, long regnum)
static std::unordered_map< riscv_gdbarch_features, const target_desc_up, riscv_gdbarch_features_hasher > riscv_tdesc_cache
const target_desc * riscv_lookup_target_description(const struct riscv_gdbarch_features features)
STATIC_IN_GDB target_desc_up riscv_create_target_description(const struct riscv_gdbarch_features features)
static int create_feature_riscv_rv32e_xregs(struct target_desc *result, long regnum)
std::size_t operator()(const riscv_gdbarch_features &features) const noexcept
void set_tdesc_architecture(struct target_desc *target_desc, const char *name)
target_desc_up allocate_target_description(void)