Index: lldb/source/Plugins/Process/Utility/RegisterInfoPOSIX_riscv64.cpp =================================================================== --- lldb/source/Plugins/Process/Utility/RegisterInfoPOSIX_riscv64.cpp +++ lldb/source/Plugins/Process/Utility/RegisterInfoPOSIX_riscv64.cpp @@ -17,6 +17,7 @@ #define GPR_OFFSET(idx) ((idx)*8 + 0) #define FPR_OFFSET(idx) ((idx)*8 + sizeof(RegisterInfoPOSIX_riscv64::GPR)) +#define VPR_OFFSET(idx) ((idx)*8 + sizeof(RegisterInfoPOSIX_riscv64::FPR)) #define REG_CONTEXT_SIZE \ (sizeof(RegisterInfoPOSIX_riscv64::GPR) + \ Index: lldb/source/Plugins/Process/Utility/RegisterInfos_riscv64.h =================================================================== --- lldb/source/Plugins/Process/Utility/RegisterInfos_riscv64.h +++ lldb/source/Plugins/Process/Utility/RegisterInfos_riscv64.h @@ -25,6 +25,10 @@ #error FPR_OFFSET must be defined before including this header file #endif +#ifndef VPR_OFFSET +#error VPR_OFFSET must be defined before including this header file +#endif + using namespace riscv_dwarf; // clang-format off @@ -42,6 +46,9 @@ // FPR register kinds array for vector registers #define FPR64_KIND(reg, generic_kind) KIND_HELPER(reg, generic_kind) +// VPR register kinds array for vector registers +#define VPR64_KIND(reg, generic_kind) KIND_HELPER(reg, generic_kind) + // Defines a 64-bit general purpose register #define DEFINE_GPR64(reg, generic_kind) DEFINE_GPR64_ALT(reg, reg, generic_kind) @@ -64,6 +71,17 @@ FPR64_KIND(fpr_##reg, generic_kind), nullptr, nullptr \ } +// Defines a 64-bit vector register +#define DEFINE_VPR64(reg, generic_kind) DEFINE_VPR64_ALT(reg, reg, generic_kind) + +// Defines a 64-bit vector register +#define DEFINE_VPR64_ALT(reg, alt, generic_kind) \ + { \ + #reg, #alt, 8, VPR_OFFSET(vpr_##reg##_riscv - vpr_first_riscv), \ + lldb::eEncodingUint, lldb::eFormatHex, \ + VPR64_KIND(vpr_##reg, generic_kind), nullptr, nullptr \ + } + // clang-format on static lldb_private::RegisterInfo g_register_infos_riscv64_le[] = { @@ -135,6 +153,39 @@ DEFINE_FPR64_ALT(ft10, f30, LLDB_INVALID_REGNUM), DEFINE_FPR64_ALT(ft11, f31, LLDB_INVALID_REGNUM), DEFINE_FPR_ALT(fcsr, nullptr, 4, LLDB_INVALID_REGNUM), + + DEFINE_VPR64(v0, LLDB_INVALID_REGNUM), + DEFINE_VPR64(v1, LLDB_INVALID_REGNUM), + DEFINE_VPR64(v2, LLDB_INVALID_REGNUM), + DEFINE_VPR64(v3, LLDB_INVALID_REGNUM), + DEFINE_VPR64(v4, LLDB_INVALID_REGNUM), + DEFINE_VPR64(v5, LLDB_INVALID_REGNUM), + DEFINE_VPR64(v6, LLDB_INVALID_REGNUM), + DEFINE_VPR64(v7, LLDB_INVALID_REGNUM), + DEFINE_VPR64(v8, LLDB_INVALID_REGNUM), + DEFINE_VPR64(v9, LLDB_INVALID_REGNUM), + DEFINE_VPR64(v10, LLDB_INVALID_REGNUM), + DEFINE_VPR64(v11, LLDB_INVALID_REGNUM), + DEFINE_VPR64(v12, LLDB_INVALID_REGNUM), + DEFINE_VPR64(v13, LLDB_INVALID_REGNUM), + DEFINE_VPR64(v14, LLDB_INVALID_REGNUM), + DEFINE_VPR64(v15, LLDB_INVALID_REGNUM), + DEFINE_VPR64(v16, LLDB_INVALID_REGNUM), + DEFINE_VPR64(v17, LLDB_INVALID_REGNUM), + DEFINE_VPR64(v18, LLDB_INVALID_REGNUM), + DEFINE_VPR64(v19, LLDB_INVALID_REGNUM), + DEFINE_VPR64(v20, LLDB_INVALID_REGNUM), + DEFINE_VPR64(v21, LLDB_INVALID_REGNUM), + DEFINE_VPR64(v22, LLDB_INVALID_REGNUM), + DEFINE_VPR64(v23, LLDB_INVALID_REGNUM), + DEFINE_VPR64(v24, LLDB_INVALID_REGNUM), + DEFINE_VPR64(v25, LLDB_INVALID_REGNUM), + DEFINE_VPR64(v26, LLDB_INVALID_REGNUM), + DEFINE_VPR64(v27, LLDB_INVALID_REGNUM), + DEFINE_VPR64(v28, LLDB_INVALID_REGNUM), + DEFINE_VPR64(v29, LLDB_INVALID_REGNUM), + DEFINE_VPR64(v30, LLDB_INVALID_REGNUM), + DEFINE_VPR64(v31, LLDB_INVALID_REGNUM), }; #endif // DECLARE_REGISTER_INFOS_RISCV64_STRUCT