diff options
author | Pavel Labath <pavel@labath.sk> | 2025-04-04 09:49:27 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-04-04 09:49:27 +0200 |
commit | e4f76e3a3335dda608c661d76efacc70e607a5e4 (patch) | |
tree | 1aba64cd61d3330a8cf23c5ea2621c9ac18943d1 /lldb/source/Commands/CommandObjectTarget.cpp | |
parent | 22130ca486b2fb43198453a53eb048cd8a97e9a8 (diff) | |
download | llvm-e4f76e3a3335dda608c661d76efacc70e607a5e4.zip llvm-e4f76e3a3335dda608c661d76efacc70e607a5e4.tar.gz llvm-e4f76e3a3335dda608c661d76efacc70e607a5e4.tar.bz2 |
Reapply "[lldb] Return *const* UnwindPlan pointers from FuncUnwinders " (#134246)
This reverts commit 094904303d50e0ab14bc5f2586a602f79af95953, reapplying
d7afafdbc464e65c56a0a1d77bad426aa7538306 (#133247).
The failure ought to be fixed by
0509932bb6a291ba11253f30c465ab3ad164ae08.
Diffstat (limited to 'lldb/source/Commands/CommandObjectTarget.cpp')
-rw-r--r-- | lldb/source/Commands/CommandObjectTarget.cpp | 106 |
1 files changed, 49 insertions, 57 deletions
diff --git a/lldb/source/Commands/CommandObjectTarget.cpp b/lldb/source/Commands/CommandObjectTarget.cpp index c77bddb..3f7d300 100644 --- a/lldb/source/Commands/CommandObjectTarget.cpp +++ b/lldb/source/Commands/CommandObjectTarget.cpp @@ -3641,77 +3641,70 @@ protected: result.GetOutputStream().Printf("\n"); - UnwindPlanSP non_callsite_unwind_plan = - func_unwinders_sp->GetUnwindPlanAtNonCallSite(*target, *thread); - if (non_callsite_unwind_plan) { + if (std::shared_ptr<const UnwindPlan> plan_sp = + func_unwinders_sp->GetUnwindPlanAtNonCallSite(*target, *thread)) { result.GetOutputStream().Printf( "Asynchronous (not restricted to call-sites) UnwindPlan is '%s'\n", - non_callsite_unwind_plan->GetSourceName().AsCString()); + plan_sp->GetSourceName().AsCString()); } - UnwindPlanSP callsite_unwind_plan = - func_unwinders_sp->GetUnwindPlanAtCallSite(*target, *thread); - if (callsite_unwind_plan) { + if (std::shared_ptr<const UnwindPlan> plan_sp = + func_unwinders_sp->GetUnwindPlanAtCallSite(*target, *thread)) { result.GetOutputStream().Printf( "Synchronous (restricted to call-sites) UnwindPlan is '%s'\n", - callsite_unwind_plan->GetSourceName().AsCString()); + plan_sp->GetSourceName().AsCString()); } - UnwindPlanSP fast_unwind_plan = - func_unwinders_sp->GetUnwindPlanFastUnwind(*target, *thread); - if (fast_unwind_plan) { - result.GetOutputStream().Printf( - "Fast UnwindPlan is '%s'\n", - fast_unwind_plan->GetSourceName().AsCString()); + if (std::shared_ptr<const UnwindPlan> plan_sp = + func_unwinders_sp->GetUnwindPlanFastUnwind(*target, *thread)) { + result.GetOutputStream().Printf("Fast UnwindPlan is '%s'\n", + plan_sp->GetSourceName().AsCString()); } result.GetOutputStream().Printf("\n"); - UnwindPlanSP assembly_sp = - func_unwinders_sp->GetAssemblyUnwindPlan(*target, *thread); - if (assembly_sp) { + if (std::shared_ptr<const UnwindPlan> plan_sp = + func_unwinders_sp->GetAssemblyUnwindPlan(*target, *thread)) { result.GetOutputStream().Printf( "Assembly language inspection UnwindPlan:\n"); - assembly_sp->Dump(result.GetOutputStream(), thread.get(), - LLDB_INVALID_ADDRESS); + plan_sp->Dump(result.GetOutputStream(), thread.get(), + LLDB_INVALID_ADDRESS); result.GetOutputStream().Printf("\n"); } - UnwindPlanSP of_unwind_sp = - func_unwinders_sp->GetObjectFileUnwindPlan(*target); - if (of_unwind_sp) { + if (std::shared_ptr<const UnwindPlan> plan_sp = + func_unwinders_sp->GetObjectFileUnwindPlan(*target)) { result.GetOutputStream().Printf("object file UnwindPlan:\n"); - of_unwind_sp->Dump(result.GetOutputStream(), thread.get(), - LLDB_INVALID_ADDRESS); + plan_sp->Dump(result.GetOutputStream(), thread.get(), + LLDB_INVALID_ADDRESS); result.GetOutputStream().Printf("\n"); } - UnwindPlanSP of_unwind_augmented_sp = - func_unwinders_sp->GetObjectFileAugmentedUnwindPlan(*target, *thread); - if (of_unwind_augmented_sp) { + if (std::shared_ptr<const UnwindPlan> plan_sp = + func_unwinders_sp->GetObjectFileAugmentedUnwindPlan(*target, + *thread)) { result.GetOutputStream().Printf("object file augmented UnwindPlan:\n"); - of_unwind_augmented_sp->Dump(result.GetOutputStream(), thread.get(), - LLDB_INVALID_ADDRESS); + plan_sp->Dump(result.GetOutputStream(), thread.get(), + LLDB_INVALID_ADDRESS); result.GetOutputStream().Printf("\n"); } - UnwindPlanSP ehframe_sp = - func_unwinders_sp->GetEHFrameUnwindPlan(*target); - if (ehframe_sp) { + if (std::shared_ptr<const UnwindPlan> plan_sp = + func_unwinders_sp->GetEHFrameUnwindPlan(*target)) { result.GetOutputStream().Printf("eh_frame UnwindPlan:\n"); - ehframe_sp->Dump(result.GetOutputStream(), thread.get(), - LLDB_INVALID_ADDRESS); + plan_sp->Dump(result.GetOutputStream(), thread.get(), + LLDB_INVALID_ADDRESS); result.GetOutputStream().Printf("\n"); } - UnwindPlanSP ehframe_augmented_sp = - func_unwinders_sp->GetEHFrameAugmentedUnwindPlan(*target, *thread); - if (ehframe_augmented_sp) { + if (std::shared_ptr<const UnwindPlan> plan_sp = + func_unwinders_sp->GetEHFrameAugmentedUnwindPlan(*target, + *thread)) { result.GetOutputStream().Printf("eh_frame augmented UnwindPlan:\n"); - ehframe_augmented_sp->Dump(result.GetOutputStream(), thread.get(), - LLDB_INVALID_ADDRESS); + plan_sp->Dump(result.GetOutputStream(), thread.get(), + LLDB_INVALID_ADDRESS); result.GetOutputStream().Printf("\n"); } - if (UnwindPlanSP plan_sp = + if (std::shared_ptr<const UnwindPlan> plan_sp = func_unwinders_sp->GetDebugFrameUnwindPlan(*target)) { result.GetOutputStream().Printf("debug_frame UnwindPlan:\n"); plan_sp->Dump(result.GetOutputStream(), thread.get(), @@ -3719,7 +3712,7 @@ protected: result.GetOutputStream().Printf("\n"); } - if (UnwindPlanSP plan_sp = + if (std::shared_ptr<const UnwindPlan> plan_sp = func_unwinders_sp->GetDebugFrameAugmentedUnwindPlan(*target, *thread)) { result.GetOutputStream().Printf("debug_frame augmented UnwindPlan:\n"); @@ -3728,36 +3721,35 @@ protected: result.GetOutputStream().Printf("\n"); } - UnwindPlanSP arm_unwind_sp = - func_unwinders_sp->GetArmUnwindUnwindPlan(*target); - if (arm_unwind_sp) { + if (std::shared_ptr<const UnwindPlan> plan_sp = + func_unwinders_sp->GetArmUnwindUnwindPlan(*target)) { result.GetOutputStream().Printf("ARM.exidx unwind UnwindPlan:\n"); - arm_unwind_sp->Dump(result.GetOutputStream(), thread.get(), - LLDB_INVALID_ADDRESS); + plan_sp->Dump(result.GetOutputStream(), thread.get(), + LLDB_INVALID_ADDRESS); result.GetOutputStream().Printf("\n"); } - if (UnwindPlanSP symfile_plan_sp = + if (std::shared_ptr<const UnwindPlan> plan_sp = func_unwinders_sp->GetSymbolFileUnwindPlan(*thread)) { result.GetOutputStream().Printf("Symbol file UnwindPlan:\n"); - symfile_plan_sp->Dump(result.GetOutputStream(), thread.get(), - LLDB_INVALID_ADDRESS); + plan_sp->Dump(result.GetOutputStream(), thread.get(), + LLDB_INVALID_ADDRESS); result.GetOutputStream().Printf("\n"); } - UnwindPlanSP compact_unwind_sp = - func_unwinders_sp->GetCompactUnwindUnwindPlan(*target); - if (compact_unwind_sp) { + if (std::shared_ptr<const UnwindPlan> plan_sp = + func_unwinders_sp->GetCompactUnwindUnwindPlan(*target)) { result.GetOutputStream().Printf("Compact unwind UnwindPlan:\n"); - compact_unwind_sp->Dump(result.GetOutputStream(), thread.get(), - LLDB_INVALID_ADDRESS); + plan_sp->Dump(result.GetOutputStream(), thread.get(), + LLDB_INVALID_ADDRESS); result.GetOutputStream().Printf("\n"); } - if (fast_unwind_plan) { + if (std::shared_ptr<const UnwindPlan> plan_sp = + func_unwinders_sp->GetUnwindPlanFastUnwind(*target, *thread)) { result.GetOutputStream().Printf("Fast UnwindPlan:\n"); - fast_unwind_plan->Dump(result.GetOutputStream(), thread.get(), - LLDB_INVALID_ADDRESS); + plan_sp->Dump(result.GetOutputStream(), thread.get(), + LLDB_INVALID_ADDRESS); result.GetOutputStream().Printf("\n"); } |