Skip to content

Commit a751f65

Browse files
authored
[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
1 parent f270a4d commit a751f65

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

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

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313

1414
#include "llvm/IR/DerivedTypes.h"
1515

16+
#include "Utility/RISCV_DWARF_Registers.h"
1617
#include "lldb/Core/PluginManager.h"
1718
#include "lldb/Core/Value.h"
1819
#include "lldb/Core/ValueObjectConstResult.h"
@@ -643,9 +644,9 @@ bool ABISysV_riscv::CreateFunctionEntryUnwindPlan(UnwindPlan &unwind_plan) {
643644
unwind_plan.Clear();
644645
unwind_plan.SetRegisterKind(eRegisterKindDWARF);
645646

646-
uint32_t pc_reg_num = LLDB_REGNUM_GENERIC_PC;
647-
uint32_t sp_reg_num = LLDB_REGNUM_GENERIC_SP;
648-
uint32_t ra_reg_num = LLDB_REGNUM_GENERIC_RA;
647+
uint32_t pc_reg_num = riscv_dwarf::dwarf_gpr_pc;
648+
uint32_t sp_reg_num = riscv_dwarf::dwarf_gpr_sp;
649+
uint32_t ra_reg_num = riscv_dwarf::dwarf_gpr_ra;
649650

650651
UnwindPlan::RowSP row(new UnwindPlan::Row);
651652

0 commit comments

Comments
 (0)