Author: dlav-sc
Date: 2024-07-17T09:36:19+01:00
New Revision: a751f653b40f2021f091a2f1ebcc2d91bc4cc89d

URL: 
https://github.com/llvm/llvm-project/commit/a751f653b40f2021f091a2f1ebcc2d91bc4cc89d
DIFF: 
https://github.com/llvm/llvm-project/commit/a751f653b40f2021f091a2f1ebcc2d91bc4cc89d.diff

LOG: [lldb][RISCV] function prologue backtrace fix (#99043)

CreateFunctionEntryUnwindPlan RISCV ABI function fix needed to receive a
valid backtrace at the start of functions.

Fixed tests for RISCV target:

TestNumThreads.NumberOfThreadsTestCase
TestCPPExceptionBreakpoints.CPPBreakpointTestCase
TestStepThroughTrampoline.StepThroughTrampoline
TestOSPluginStepping.TestOSPluginStepping
TestSteppingOutWithArtificialFrames.TestArtificialFrameThreadStepOut1
TestStepAvoidsRegexp.StepAvoidsRegexTestCase
TestInlineStepping.TestInlineStepping
TestStepOverBreakpoint.StepOverBreakpointsTestCase
TestStepOverBreakpoint.StepOverBreakpointsTestCase
TestSteppingOutWithArtificialFrames.TestArtificialFrameThreadStepOut1
TestTailCallFrameSBAPI.TestTailCallFrameSBAPI
TestThreadPlanUserBreakpoint.ThreadPlanUserBreakpointsTestCase

Added: 
    

Modified: 
    lldb/source/Plugins/ABI/RISCV/ABISysV_riscv.cpp

Removed: 
    


################################################################################
diff  --git a/lldb/source/Plugins/ABI/RISCV/ABISysV_riscv.cpp 
b/lldb/source/Plugins/ABI/RISCV/ABISysV_riscv.cpp
index 6395f5bb5bd9b..35d4f0521bf1f 100644
--- a/lldb/source/Plugins/ABI/RISCV/ABISysV_riscv.cpp
+++ b/lldb/source/Plugins/ABI/RISCV/ABISysV_riscv.cpp
@@ -13,6 +13,7 @@
 
 #include "llvm/IR/DerivedTypes.h"
 
+#include "Utility/RISCV_DWARF_Registers.h"
 #include "lldb/Core/PluginManager.h"
 #include "lldb/Core/Value.h"
 #include "lldb/Core/ValueObjectConstResult.h"
@@ -643,9 +644,9 @@ bool 
ABISysV_riscv::CreateFunctionEntryUnwindPlan(UnwindPlan &unwind_plan) {
   unwind_plan.Clear();
   unwind_plan.SetRegisterKind(eRegisterKindDWARF);
 
-  uint32_t pc_reg_num = LLDB_REGNUM_GENERIC_PC;
-  uint32_t sp_reg_num = LLDB_REGNUM_GENERIC_SP;
-  uint32_t ra_reg_num = LLDB_REGNUM_GENERIC_RA;
+  uint32_t pc_reg_num = riscv_dwarf::dwarf_gpr_pc;
+  uint32_t sp_reg_num = riscv_dwarf::dwarf_gpr_sp;
+  uint32_t ra_reg_num = riscv_dwarf::dwarf_gpr_ra;
 
   UnwindPlan::RowSP row(new UnwindPlan::Row);
 


        
_______________________________________________
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

Reply via email to