@@ -2486,7 +2486,7 @@ static llvm::Expected<addr_t> ReadPtrFromAddr(Process &process, addr_t addr,
2486
2486
// / access to those here would be challenging.
2487
2487
static llvm::Expected<addr_t > GetCFA (Process &process, RegisterContext ®ctx,
2488
2488
addr_t pc_offset,
2489
- UnwindPlan &unwind_plan) {
2489
+ const UnwindPlan &unwind_plan) {
2490
2490
auto *row = unwind_plan.GetRowForFunctionOffset (pc_offset);
2491
2491
if (!row)
2492
2492
return llvm::createStringError (
@@ -2516,22 +2516,22 @@ static llvm::Expected<addr_t> GetCFA(Process &process, RegisterContext ®ctx,
2516
2516
cfa_loc.GetValueType ());
2517
2517
}
2518
2518
2519
- static UnwindPlanSP GetUnwindPlanForAsyncRegister (FuncUnwinders &unwinders,
2520
- Target &target,
2521
- Thread &thread) {
2519
+ static std::shared_ptr< const UnwindPlan>
2520
+ GetUnwindPlanForAsyncRegister (FuncUnwinders &unwinders, Target &target,
2521
+ Thread &thread) {
2522
2522
// We cannot trust compiler emitted unwind plans, as they respect the
2523
2523
// swifttail calling convention, which assumes the async register is _not_
2524
2524
// restored and therefore it is not tracked by compiler plans. If LLDB uses
2525
2525
// those plans, it may take "no info" to mean "register not clobbered". For
2526
2526
// those reasons, always favour the assembly plan first, it will try to track
2527
2527
// the async register by assuming the usual arm calling conventions.
2528
- if (UnwindPlanSP asm_plan = unwinders.GetAssemblyUnwindPlan (target, thread))
2528
+ if (auto asm_plan = unwinders.GetAssemblyUnwindPlan (target, thread))
2529
2529
return asm_plan;
2530
2530
// In the unlikely case the assembly plan is not available, try all others.
2531
2531
return unwinders.GetUnwindPlanAtNonCallSite (target, thread);
2532
2532
}
2533
2533
2534
- static llvm::Expected<UnwindPlanSP >
2534
+ static llvm::Expected<std::shared_ptr< const UnwindPlan> >
2535
2535
GetAsmUnwindPlan (Address pc, SymbolContext &sc, Thread &thread) {
2536
2536
FuncUnwindersSP unwinders =
2537
2537
pc.GetModule ()->GetUnwindTable ().GetFuncUnwindersContainingAddress (pc,
@@ -2541,7 +2541,7 @@ GetAsmUnwindPlan(Address pc, SymbolContext &sc, Thread &thread) {
2541
2541
" function unwinder at address 0x%8.8" PRIx64,
2542
2542
pc.GetFileAddress ());
2543
2543
2544
- UnwindPlanSP unwind_plan = GetUnwindPlanForAsyncRegister (
2544
+ auto unwind_plan = GetUnwindPlanForAsyncRegister (
2545
2545
*unwinders, thread.GetProcess ()->GetTarget (), thread);
2546
2546
if (!unwind_plan)
2547
2547
return llvm::createStringError (
@@ -2551,8 +2551,8 @@ GetAsmUnwindPlan(Address pc, SymbolContext &sc, Thread &thread) {
2551
2551
return unwind_plan;
2552
2552
}
2553
2553
2554
- static llvm::Expected<uint32_t > GetFpRegisterNumber (UnwindPlan &unwind_plan,
2555
- RegisterContext ®ctx) {
2554
+ static llvm::Expected<uint32_t >
2555
+ GetFpRegisterNumber ( const UnwindPlan &unwind_plan, RegisterContext ®ctx) {
2556
2556
uint32_t fp_unwind_regdomain;
2557
2557
if (!regctx.ConvertBetweenRegisterKinds (
2558
2558
lldb::eRegisterKindGeneric, LLDB_REGNUM_GENERIC_FP,
@@ -2580,7 +2580,7 @@ struct FrameSetupInfo {
2580
2580
// / compared against it.
2581
2581
// / 2. The CFA offset at which FP is stored, meaningless in the frameless case.
2582
2582
static llvm::Expected<FrameSetupInfo>
2583
- GetFrameSetupInfo (UnwindPlan &unwind_plan, RegisterContext ®ctx) {
2583
+ GetFrameSetupInfo (const UnwindPlan &unwind_plan, RegisterContext ®ctx) {
2584
2584
using AbstractRegisterLocation = UnwindPlan::Row::AbstractRegisterLocation;
2585
2585
2586
2586
llvm::Expected<uint32_t > fp_unwind_regdomain =
@@ -2645,7 +2645,7 @@ GetFrameSetupInfo(UnwindPlan &unwind_plan, RegisterContext ®ctx) {
2645
2645
static llvm::Expected<addr_t > ReadAsyncContextRegisterFromUnwind (
2646
2646
SymbolContext &sc, Process &process, Address pc, Address func_start_addr,
2647
2647
RegisterContext ®ctx, AsyncUnwindRegisterNumbers regnums) {
2648
- llvm::Expected<UnwindPlanSP > unwind_plan =
2648
+ llvm::Expected<std::shared_ptr< const UnwindPlan> > unwind_plan =
2649
2649
GetAsmUnwindPlan (pc, sc, regctx.GetThread ());
2650
2650
if (!unwind_plan)
2651
2651
return unwind_plan.takeError ();
0 commit comments