[Lldb-commits] [lldb] [lldb][RISCV] Fix GetRegisterInfo to support RISCV-32 (PR #175262)
Jonas Devlieghere via lldb-commits
lldb-commits at lists.llvm.org
Wed Jan 14 21:51:38 PST 2026
================
@@ -806,3 +807,21 @@ TEST_F(RISCVEmulatorTester, TestFMV_D_XInst) {
ASSERT_TRUE(this->Execute(*decode, false));
ASSERT_EQ(this->fpr.fpr[DecodeRD(FMV_D_XInst)], bits);
}
+
+TEST_F(RISCVEmulatorTester, TestGetRegisterInfoRV64) {
+ // Test that GetRegisterInfo returns valid register info for RV64
+ auto reg_info = this->GetRegisterInfo(eRegisterKindLLDB, gpr_x1_riscv);
+ ASSERT_TRUE(reg_info.has_value());
+ ASSERT_EQ(reg_info->byte_size, 8u);
+ ASSERT_STREQ(reg_info->name, "ra");
+}
+
+TEST_F(RISCVEmulatorTester32, TestGetRegisterInfoRV32) {
+ // Test that GetRegisterInfo returns valid register info for RV32
+ // This verifies the fix for issue #175092 where GetRegisterInfo was
+ // hardcoded to use RegisterInfoPOSIX_riscv64
----------------
JDevlieghere wrote:
Testing the desired behavior is sufficient. We can use git blame to figure out why the test was added if anyone wants to find out.
```suggestion
// Test that GetRegisterInfo returns valid register info for riscv32.
```
https://github.com/llvm/llvm-project/pull/175262
More information about the lldb-commits
mailing list