From 1b9b4f658f71537630c3aab1505d92bba0f00b35 Mon Sep 17 00:00:00 2001 From: Daniil Avdeev Date: Thu, 4 Jul 2024 13:57:03 +0000 Subject: [PATCH] [lldb] function prologue backtrace fix 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 --- lldb/source/Plugins/ABI/RISCV/ABISysV_riscv.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) 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);