Skip to content

[lldb] Return *const* UnwindPlan pointers from FuncUnwinders #133247

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 2, 2025

Conversation

labath
Copy link
Collaborator

@labath labath commented Mar 27, 2025

These plans are cached and accessed from multiple threads. Modifying them would be a Bad Idea(tm).

These plans are cached and accessed from multiple threads. Modifying
them would be a Bad Idea(tm).
@labath labath requested a review from JDevlieghere as a code owner March 27, 2025 12:57
@llvmbot llvmbot added the lldb label Mar 27, 2025
@llvmbot
Copy link
Member

llvmbot commented Mar 27, 2025

@llvm/pr-subscribers-lldb

Author: Pavel Labath (labath)

Changes

These plans are cached and accessed from multiple threads. Modifying them would be a Bad Idea(tm).


Patch is 48.49 KiB, truncated to 20.00 KiB below, full version: https://github.com/llvm/llvm-project/pull/133247.diff

7 Files Affected:

  • (modified) lldb/include/lldb/Symbol/FuncUnwinders.h (+41-37)
  • (modified) lldb/include/lldb/Symbol/UnwindPlan.h (+2-2)
  • (modified) lldb/include/lldb/Target/RegisterContextUnwind.h (+9-7)
  • (modified) lldb/source/Commands/CommandObjectTarget.cpp (+49-57)
  • (modified) lldb/source/Symbol/FuncUnwinders.cpp (+105-102)
  • (modified) lldb/source/Symbol/UnwindPlan.cpp (+1-1)
  • (modified) lldb/source/Target/RegisterContextUnwind.cpp (+40-44)
diff --git a/lldb/include/lldb/Symbol/FuncUnwinders.h b/lldb/include/lldb/Symbol/FuncUnwinders.h
index 1d4c28324e90f..479ccf87b6e2c 100644
--- a/lldb/include/lldb/Symbol/FuncUnwinders.h
+++ b/lldb/include/lldb/Symbol/FuncUnwinders.h
@@ -36,18 +36,19 @@ class FuncUnwinders {
 
   ~FuncUnwinders();
 
-  lldb::UnwindPlanSP GetUnwindPlanAtCallSite(Target &target, Thread &thread);
+  std::shared_ptr<const UnwindPlan> GetUnwindPlanAtCallSite(Target &target,
+                                                            Thread &thread);
 
-  lldb::UnwindPlanSP GetUnwindPlanAtNonCallSite(Target &target,
-                                                lldb_private::Thread &thread);
+  std::shared_ptr<const UnwindPlan>
+  GetUnwindPlanAtNonCallSite(Target &target, lldb_private::Thread &thread);
 
-  lldb::UnwindPlanSP GetUnwindPlanFastUnwind(Target &target,
-                                             lldb_private::Thread &thread);
+  std::shared_ptr<const UnwindPlan>
+  GetUnwindPlanFastUnwind(Target &target, lldb_private::Thread &thread);
 
-  lldb::UnwindPlanSP
+  std::shared_ptr<const UnwindPlan>
   GetUnwindPlanArchitectureDefault(lldb_private::Thread &thread);
 
-  lldb::UnwindPlanSP
+  std::shared_ptr<const UnwindPlan>
   GetUnwindPlanArchitectureDefaultAtFunctionEntry(lldb_private::Thread &thread);
 
   Address &GetFirstNonPrologueInsn(Target &target);
@@ -77,32 +78,34 @@ class FuncUnwinders {
   // used. Instead, clients should ask for the *behavior* they are looking for,
   // using one of the above UnwindPlan retrieval methods.
 
-  lldb::UnwindPlanSP GetAssemblyUnwindPlan(Target &target, Thread &thread);
+  std::shared_ptr<const UnwindPlan> GetAssemblyUnwindPlan(Target &target,
+                                                          Thread &thread);
 
-  lldb::UnwindPlanSP GetObjectFileUnwindPlan(Target &target);
+  std::shared_ptr<const UnwindPlan> GetObjectFileUnwindPlan(Target &target);
 
-  lldb::UnwindPlanSP GetObjectFileAugmentedUnwindPlan(Target &target,
-                                                      Thread &thread);
+  std::shared_ptr<const UnwindPlan>
+  GetObjectFileAugmentedUnwindPlan(Target &target, Thread &thread);
 
-  lldb::UnwindPlanSP GetEHFrameUnwindPlan(Target &target);
+  std::shared_ptr<const UnwindPlan> GetEHFrameUnwindPlan(Target &target);
 
-  lldb::UnwindPlanSP GetEHFrameAugmentedUnwindPlan(Target &target,
-                                                   Thread &thread);
+  std::shared_ptr<const UnwindPlan>
+  GetEHFrameAugmentedUnwindPlan(Target &target, Thread &thread);
 
-  lldb::UnwindPlanSP GetDebugFrameUnwindPlan(Target &target);
+  std::shared_ptr<const UnwindPlan> GetDebugFrameUnwindPlan(Target &target);
 
-  lldb::UnwindPlanSP GetDebugFrameAugmentedUnwindPlan(Target &target,
-                                                      Thread &thread);
+  std::shared_ptr<const UnwindPlan>
+  GetDebugFrameAugmentedUnwindPlan(Target &target, Thread &thread);
 
-  lldb::UnwindPlanSP GetCompactUnwindUnwindPlan(Target &target);
+  std::shared_ptr<const UnwindPlan> GetCompactUnwindUnwindPlan(Target &target);
 
-  lldb::UnwindPlanSP GetArmUnwindUnwindPlan(Target &target);
+  std::shared_ptr<const UnwindPlan> GetArmUnwindUnwindPlan(Target &target);
 
-  lldb::UnwindPlanSP GetSymbolFileUnwindPlan(Thread &thread);
+  std::shared_ptr<const UnwindPlan> GetSymbolFileUnwindPlan(Thread &thread);
 
-  lldb::UnwindPlanSP GetArchDefaultUnwindPlan(Thread &thread);
+  std::shared_ptr<const UnwindPlan> GetArchDefaultUnwindPlan(Thread &thread);
 
-  lldb::UnwindPlanSP GetArchDefaultAtFuncEntryUnwindPlan(Thread &thread);
+  std::shared_ptr<const UnwindPlan>
+  GetArchDefaultAtFuncEntryUnwindPlan(Thread &thread);
 
 private:
   lldb::UnwindAssemblySP GetUnwindAssemblyProfiler(Target &target);
@@ -113,7 +116,8 @@ class FuncUnwinders {
   // unwind rule for the pc, and LazyBoolCalculate if it was unable to
   // determine this for some reason.
   lldb_private::LazyBool CompareUnwindPlansForIdenticalInitialPCLocation(
-      Thread &thread, const lldb::UnwindPlanSP &a, const lldb::UnwindPlanSP &b);
+      Thread &thread, const std::shared_ptr<const UnwindPlan> &a,
+      const std::shared_ptr<const UnwindPlan> &b);
 
   UnwindTable &m_unwind_table;
 
@@ -129,22 +133,22 @@ class FuncUnwinders {
 
   std::recursive_mutex m_mutex;
 
-  lldb::UnwindPlanSP m_unwind_plan_assembly_sp;
-  lldb::UnwindPlanSP m_unwind_plan_object_file_sp;
-  lldb::UnwindPlanSP m_unwind_plan_eh_frame_sp;
-  lldb::UnwindPlanSP m_unwind_plan_debug_frame_sp;
+  std::shared_ptr<const UnwindPlan> m_unwind_plan_assembly_sp;
+  std::shared_ptr<const UnwindPlan> m_unwind_plan_object_file_sp;
+  std::shared_ptr<const UnwindPlan> m_unwind_plan_eh_frame_sp;
+  std::shared_ptr<const UnwindPlan> m_unwind_plan_debug_frame_sp;
 
   // augmented by assembly inspection so it's valid everywhere
-  lldb::UnwindPlanSP m_unwind_plan_object_file_augmented_sp;
-  lldb::UnwindPlanSP m_unwind_plan_eh_frame_augmented_sp;
-  lldb::UnwindPlanSP m_unwind_plan_debug_frame_augmented_sp;
-
-  std::vector<lldb::UnwindPlanSP> m_unwind_plan_compact_unwind;
-  lldb::UnwindPlanSP m_unwind_plan_arm_unwind_sp;
-  lldb::UnwindPlanSP m_unwind_plan_symbol_file_sp;
-  lldb::UnwindPlanSP m_unwind_plan_fast_sp;
-  lldb::UnwindPlanSP m_unwind_plan_arch_default_sp;
-  lldb::UnwindPlanSP m_unwind_plan_arch_default_at_func_entry_sp;
+  std::shared_ptr<const UnwindPlan> m_unwind_plan_object_file_augmented_sp;
+  std::shared_ptr<const UnwindPlan> m_unwind_plan_eh_frame_augmented_sp;
+  std::shared_ptr<const UnwindPlan> m_unwind_plan_debug_frame_augmented_sp;
+
+  std::vector<std::shared_ptr<const UnwindPlan>> m_unwind_plan_compact_unwind;
+  std::shared_ptr<const UnwindPlan> m_unwind_plan_arm_unwind_sp;
+  std::shared_ptr<const UnwindPlan> m_unwind_plan_symbol_file_sp;
+  std::shared_ptr<const UnwindPlan> m_unwind_plan_fast_sp;
+  std::shared_ptr<const UnwindPlan> m_unwind_plan_arch_default_sp;
+  std::shared_ptr<const UnwindPlan> m_unwind_plan_arch_default_at_func_entry_sp;
 
   // Fetching the UnwindPlans can be expensive - if we've already attempted to
   // get one & failed, don't try again.
diff --git a/lldb/include/lldb/Symbol/UnwindPlan.h b/lldb/include/lldb/Symbol/UnwindPlan.h
index ddc54a9fdc8ae..80517de5a7e9c 100644
--- a/lldb/include/lldb/Symbol/UnwindPlan.h
+++ b/lldb/include/lldb/Symbol/UnwindPlan.h
@@ -464,7 +464,7 @@ class UnwindPlan {
     m_return_addr_register = regnum;
   }
 
-  uint32_t GetReturnAddressRegister() { return m_return_addr_register; }
+  uint32_t GetReturnAddressRegister() const { return m_return_addr_register; }
 
   uint32_t GetInitialCFARegister() const {
     if (m_row_list.empty())
@@ -479,7 +479,7 @@ class UnwindPlan {
     m_plan_valid_ranges = std::move(ranges);
   }
 
-  bool PlanValidAtAddress(Address addr);
+  bool PlanValidAtAddress(Address addr) const;
 
   bool IsValidRowIndex(uint32_t idx) const;
 
diff --git a/lldb/include/lldb/Target/RegisterContextUnwind.h b/lldb/include/lldb/Target/RegisterContextUnwind.h
index 6cd918fedc003..98e25859d4eab 100644
--- a/lldb/include/lldb/Target/RegisterContextUnwind.h
+++ b/lldb/include/lldb/Target/RegisterContextUnwind.h
@@ -127,7 +127,8 @@ class RegisterContextUnwind : public lldb_private::RegisterContext {
 
   /// Check if the given unwind plan indicates a signal trap handler, and
   /// update frame type and symbol context if so.
-  void PropagateTrapHandlerFlagFromUnwindPlan(lldb::UnwindPlanSP unwind_plan);
+  void PropagateTrapHandlerFlagFromUnwindPlan(
+      std::shared_ptr<const UnwindPlan> unwind_plan);
 
   // Provide a location for where THIS function saved the CALLER's register
   // value
@@ -194,16 +195,17 @@ class RegisterContextUnwind : public lldb_private::RegisterContext {
                         const UnwindPlan::Row::FAValue &fa,
                         lldb::addr_t &address);
 
-  lldb::UnwindPlanSP GetFastUnwindPlanForFrame();
+  std::shared_ptr<const UnwindPlan> GetFastUnwindPlanForFrame();
 
-  lldb::UnwindPlanSP GetFullUnwindPlanForFrame();
+  std::shared_ptr<const UnwindPlan> GetFullUnwindPlanForFrame();
 
   void UnwindLogMsg(const char *fmt, ...) __attribute__((format(printf, 2, 3)));
 
   void UnwindLogMsgVerbose(const char *fmt, ...)
       __attribute__((format(printf, 2, 3)));
 
-  bool IsUnwindPlanValidForCurrentPC(lldb::UnwindPlanSP unwind_plan_sp);
+  bool IsUnwindPlanValidForCurrentPC(
+      std::shared_ptr<const UnwindPlan> unwind_plan_sp);
 
   lldb::addr_t GetReturnAddressHint(int32_t plan_offset);
 
@@ -215,9 +217,9 @@ class RegisterContextUnwind : public lldb_private::RegisterContext {
   // i.e. where THIS frame saved them
   ///
 
-  lldb::UnwindPlanSP m_fast_unwind_plan_sp; // may be NULL
-  lldb::UnwindPlanSP m_full_unwind_plan_sp;
-  lldb::UnwindPlanSP m_fallback_unwind_plan_sp; // may be NULL
+  std::shared_ptr<const UnwindPlan> m_fast_unwind_plan_sp; // may be NULL
+  std::shared_ptr<const UnwindPlan> m_full_unwind_plan_sp;
+  std::shared_ptr<const UnwindPlan> m_fallback_unwind_plan_sp; // may be NULL
 
   bool m_all_registers_available; // Can we retrieve all regs or just
                                   // nonvolatile regs?
diff --git a/lldb/source/Commands/CommandObjectTarget.cpp b/lldb/source/Commands/CommandObjectTarget.cpp
index c77bddb4af061..3f7d3007ed168 100644
--- a/lldb/source/Commands/CommandObjectTarget.cpp
+++ b/lldb/source/Commands/CommandObjectTarget.cpp
@@ -3641,77 +3641,70 @@ class CommandObjectTargetModulesShowUnwind : public CommandObjectParsed {
 
       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 @@ class CommandObjectTargetModulesShowUnwind : public CommandObjectParsed {
         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 @@ class CommandObjectTargetModulesShowUnwind : public CommandObjectParsed {
         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");
       }
 
diff --git a/lldb/source/Symbol/FuncUnwinders.cpp b/lldb/source/Symbol/FuncUnwinders.cpp
index a5ca7b094c949..a74029d8343c7 100644
--- a/lldb/source/Symbol/FuncUnwinders.cpp
+++ b/lldb/source/Symbol/FuncUnwinders.cpp
@@ -71,40 +71,47 @@ FuncUnwinders::FuncUnwinders(UnwindTable &unwind_table, Address addr,
 
 FuncUnwinders::~FuncUnwinders() = default;
 
-UnwindPlanSP FuncUnwinders::GetUnwindPlanAtCallSite(Target &target,
-                                                    Thread &thread) {
+std::shared_ptr<const UnwindPlan>
+FuncUnwinders::GetUnwindPlanAtCallSite(Target &target, Thread &thread) {
   std::lock_guard<std::recursive_mutex> guard(m_mutex);
 
-  if (UnwindPlanSP plan_sp = GetObjectFileUnwindPlan(target))
+  if (std::shared_ptr<const UnwindPlan> plan_sp =
+          GetObjectFileUnwindPlan(target))
     return plan_sp;
-  if (UnwindPlanSP plan_sp = GetSymbolFileUnwindPlan(thread))
+  if (std::shared_ptr<const UnwindPlan> plan_sp =
+          GetSymbolFileUnwindPlan(thread))
     return plan_sp;
-  if (UnwindPlanSP plan_sp = GetDebugFrameUnwindPlan(target))
+  if (std::shared_ptr<const UnwindPlan> plan_sp =
+          GetDebugFrameUnwindPlan(target))
     return plan_sp;
-  if (UnwindPlanSP plan_sp = GetEHFrameUnwindPlan(target))
+  if (std::shared_ptr<const UnwindPlan> plan_sp = GetEHFrameUnwindPlan(target))
     return plan_sp;
-  if (UnwindPlanSP plan_sp = GetCompactUnwindUnwindPlan(target))
+  if (std::shared_ptr<const UnwindPlan> plan_sp =
+          GetCompactUnwindUnwindPlan(target))
     return plan_sp;
-  if (UnwindPlanSP plan_sp = GetArmUnwindUnwindPlan(target))
+  if (std::shared_ptr<const UnwindPlan> plan_sp =
+          GetArmUnwindUnwindPlan(target))
     return plan_sp;
 
   return nullptr;
 }
 
-UnwindPlanSP FuncUnwinders::GetCompactUnwindUnwindPlan(Target &target) {
+std::shared_ptr<const UnwindPlan>
+FuncUnwinders::GetCompactUnwindUnwindPlan(Target &target) {
   std::lock_guard<std::recursive_mutex> guard(m_mutex);
   if (m_unwind_plan_compact_unwind.size() > 0)
     return m_unwind_plan_compact_unwind[0]; // FIXME support multiple compact
                                             // unwind plans for one func
   if (m_tried_unwind_plan_compact_unwind)
-    return UnwindPlanSP();
+    return nullptr;
 
   m_tried_unwind_plan_compact_unwind = true;
   if (m_range.GetBaseAddress().IsValid()) {
     Address current_pc(m_range.GetBaseAddress());
     CompactUnwindInfo *compact_unwind = m_unwind_table.GetCompactUnwindInfo();
     if (compact_unwind) {
-      UnwindPlanSP unwind_plan_sp(new UnwindPlan(lldb::eRegisterKindGeneric));...
[truncated]

Copy link
Member

@JDevlieghere JDevlieghere left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM™ assuming the answer to my inline question is "no".

@@ -36,18 +36,19 @@ class FuncUnwinders {

~FuncUnwinders();

lldb::UnwindPlanSP GetUnwindPlanAtCallSite(Target &target, Thread &thread);
std::shared_ptr<const UnwindPlan> GetUnwindPlanAtCallSite(Target &target,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we change the UnwindPlanSP typedef? Do we ever need a non-const UnwindPlan shared pointer?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Currently we need them, because the unwind plans are (sometimes) stored in a shared pointer while they are being constructed. That could be avoided because we don't really need the shared ownership at that point (they could be a unique_ptr or a value). However, I'm not particularly thrilled with the idea of repurposing UnwindPlanSP for this, as I think that would be surprising -- there's nothing in that name that indicates this is a const pointer, and I think it's important to see that.

One idea I have had that could solve this (but have never found the time to propose) is to replace the individual FoobarSP typedefs with a SP = std::shared_ptr<T> template alias. That would let us write SP<const Foobar> in exactly the places which need it; and it might also help with the hypothetical migration to the llvm naming convention (frees up FoobarSP as a member name)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense.

One idea I have had that could solve this (but have never found the time to propose) is to replace the individual FoobarSP typedefs with a SP = std::shared_ptr template alias. That would let us write SP in exactly the places which need it; and it might also help with the hypothetical migration to the llvm naming convention (frees up FoobarSP as a member name)

Yeah, I remember you suggesting that in https://reviews.llvm.org/D133906. At the time I played around with a regex/python script to replace the existing FoobarSPs and it somehow was a lot harder to get right than I expected.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Heh, that seems like quite a long time ago. Well.. I guess I'm at least consistent :)

I didn't realize you were actually experimenting with that approach. I'm going to take this to mean that such an idea has a non-zero chance of being accepted :) (ofc, there should be an rfc for that, and ideally some semi-automated method/tool to do the conversion)

@labath labath merged commit d7afafd into llvm:main Apr 2, 2025
18 checks passed
@llvm-ci
Copy link
Collaborator

llvm-ci commented Apr 2, 2025

LLVM Buildbot has detected a new failure on builder lldb-aarch64-ubuntu running on linaro-lldb-aarch64-ubuntu while building lldb at step 6 "test".

Full details are available at: https://lab.llvm.org/buildbot/#/builders/59/builds/15320

Here is the relevant piece of the build log for the reference
Step 6 (test) failure: build (failure)
...
PASS: lldb-api :: commands/expression/persistent_ptr_update/TestPersistentPtrUpdate.py (112 of 2113)
PASS: lldb-api :: commands/expression/options/TestExprOptions.py (113 of 2113)
PASS: lldb-api :: commands/expression/nested/TestNestedExpressions.py (114 of 2113)
PASS: lldb-api :: commands/expression/persistent_types/TestNestedPersistentTypes.py (115 of 2113)
UNSUPPORTED: lldb-api :: commands/expression/po_persistent_result/TestPoPersistentResult.py (116 of 2113)
UNSUPPORTED: lldb-api :: commands/expression/po_verbosity/TestPoVerbosity.py (117 of 2113)
PASS: lldb-api :: commands/expression/persistent_types/TestPersistentTypes.py (118 of 2113)
PASS: lldb-api :: commands/expression/no-deadlock/TestExprDoesntBlock.py (119 of 2113)
PASS: lldb-api :: commands/expression/persistent_variables/TestPersistentVariables.py (120 of 2113)
PASS: lldb-api :: commands/expression/pr52257/TestExprCrash.py (121 of 2113)
FAIL: lldb-api :: commands/expression/persistent_result/TestPersistentResult.py (122 of 2113)
******************** TEST 'lldb-api :: commands/expression/persistent_result/TestPersistentResult.py' FAILED ********************
Script:
--
/usr/bin/python3.10 /home/tcwg-buildbot/worker/lldb-aarch64-ubuntu/llvm-project/lldb/test/API/dotest.py -u CXXFLAGS -u CFLAGS --env LLVM_LIBS_DIR=/home/tcwg-buildbot/worker/lldb-aarch64-ubuntu/build/./lib --env LLVM_INCLUDE_DIR=/home/tcwg-buildbot/worker/lldb-aarch64-ubuntu/build/include --env LLVM_TOOLS_DIR=/home/tcwg-buildbot/worker/lldb-aarch64-ubuntu/build/./bin --arch aarch64 --build-dir /home/tcwg-buildbot/worker/lldb-aarch64-ubuntu/build/lldb-test-build.noindex --lldb-module-cache-dir /home/tcwg-buildbot/worker/lldb-aarch64-ubuntu/build/lldb-test-build.noindex/module-cache-lldb/lldb-api --clang-module-cache-dir /home/tcwg-buildbot/worker/lldb-aarch64-ubuntu/build/lldb-test-build.noindex/module-cache-clang/lldb-api --executable /home/tcwg-buildbot/worker/lldb-aarch64-ubuntu/build/./bin/lldb --compiler /home/tcwg-buildbot/worker/lldb-aarch64-ubuntu/build/./bin/clang --dsymutil /home/tcwg-buildbot/worker/lldb-aarch64-ubuntu/build/./bin/dsymutil --make /usr/bin/gmake --llvm-tools-dir /home/tcwg-buildbot/worker/lldb-aarch64-ubuntu/build/./bin --lldb-obj-root /home/tcwg-buildbot/worker/lldb-aarch64-ubuntu/build/tools/lldb --lldb-libs-dir /home/tcwg-buildbot/worker/lldb-aarch64-ubuntu/build/./lib /home/tcwg-buildbot/worker/lldb-aarch64-ubuntu/llvm-project/lldb/test/API/commands/expression/persistent_result -p TestPersistentResult.py
--
Exit Code: -11

Command Output (stdout):
--
lldb version 21.0.0git (https://github.com/llvm/llvm-project.git revision d7afafdbc464e65c56a0a1d77bad426aa7538306)
  clang revision d7afafdbc464e65c56a0a1d77bad426aa7538306
  llvm revision d7afafdbc464e65c56a0a1d77bad426aa7538306
Skipping the following test categories: ['libc++', 'dsym', 'gmodules', 'debugserver', 'objc']

--
Command Output (stderr):
--
UNSUPPORTED: LLDB (/home/tcwg-buildbot/worker/lldb-aarch64-ubuntu/build/bin/clang-aarch64) :: test_disable_persistent_result_dsym (TestPersistentResult.TestCase) (test case does not fall in any category of interest for this run) 
PASS: LLDB (/home/tcwg-buildbot/worker/lldb-aarch64-ubuntu/build/bin/clang-aarch64) :: test_disable_persistent_result_dwarf (TestPersistentResult.TestCase)
PASS: LLDB (/home/tcwg-buildbot/worker/lldb-aarch64-ubuntu/build/bin/clang-aarch64) :: test_disable_persistent_result_dwo (TestPersistentResult.TestCase)
UNSUPPORTED: LLDB (/home/tcwg-buildbot/worker/lldb-aarch64-ubuntu/build/bin/clang-aarch64) :: test_enable_persistent_result_dsym (TestPersistentResult.TestCase) (test case does not fall in any category of interest for this run) 
PASS: LLDB (/home/tcwg-buildbot/worker/lldb-aarch64-ubuntu/build/bin/clang-aarch64) :: test_enable_persistent_result_dwarf (TestPersistentResult.TestCase)
PASS: LLDB (/home/tcwg-buildbot/worker/lldb-aarch64-ubuntu/build/bin/clang-aarch64) :: test_enable_persistent_result_dwo (TestPersistentResult.TestCase)
UNSUPPORTED: LLDB (/home/tcwg-buildbot/worker/lldb-aarch64-ubuntu/build/bin/clang-aarch64) :: test_expression_persists_result_dsym (TestPersistentResult.TestCase) (test case does not fall in any category of interest for this run) 
PASS: LLDB (/home/tcwg-buildbot/worker/lldb-aarch64-ubuntu/build/bin/clang-aarch64) :: test_expression_persists_result_dwarf (TestPersistentResult.TestCase)
PASS: LLDB (/home/tcwg-buildbot/worker/lldb-aarch64-ubuntu/build/bin/clang-aarch64) :: test_expression_persists_result_dwo (TestPersistentResult.TestCase)
UNSUPPORTED: LLDB (/home/tcwg-buildbot/worker/lldb-aarch64-ubuntu/build/bin/clang-aarch64) :: test_p_does_not_persist_results_dsym (TestPersistentResult.TestCase) (test case does not fall in any category of interest for this run) 
PASS: LLDB (/home/tcwg-buildbot/worker/lldb-aarch64-ubuntu/build/bin/clang-aarch64) :: test_p_does_not_persist_results_dwarf (TestPersistentResult.TestCase)
PASS: LLDB (/home/tcwg-buildbot/worker/lldb-aarch64-ubuntu/build/bin/clang-aarch64) :: test_p_does_not_persist_results_dwo (TestPersistentResult.TestCase)
----------------------------------------------------------------------
Ran 12 tests in 1.985s

OK (skipped=4)

--

********************
PASS: lldb-api :: commands/expression/radar_8638051/Test8638051.py (123 of 2113)

@labath labath deleted the const-plan branch April 2, 2025 12:48
@slydiman
Copy link
Contributor

slydiman commented Apr 2, 2025

@labath

LLVM Buildbot has detected a new failure on builder lldb-aarch64-ubuntu

lldb-remote-linux-ubuntu is broken too.

@labath
Copy link
Collaborator Author

labath commented Apr 2, 2025

The aarch64 thing was a flake, though this appears to be a genuine (if surprising) failure. I can check it out tomorrow. Feel free to revert for the time being.

@slydiman
Copy link
Contributor

slydiman commented Apr 3, 2025

lldb-shell::ProcessMachCoreArch.test is flake.
But the following tests are broken by this commit (segmentation fault on x86_64 host):

  1. lldb-api::TestMiniDump.py:
2  _lldb.cpython-312-x86_64-linux-gnu.so 0x0000751c11a3cd14
3  libc.so.6                             0x0000751c18845330
4  _lldb.cpython-312-x86_64-linux-gnu.so 0x0000751c11459af7
5  _lldb.cpython-312-x86_64-linux-gnu.so 0x0000751c1145f215
6  _lldb.cpython-312-x86_64-linux-gnu.so 0x0000751c1145f9b3
7  _lldb.cpython-312-x86_64-linux-gnu.so 0x0000751c1143e18d
8  _lldb.cpython-312-x86_64-linux-gnu.so 0x0000751c1143ea75
9  _lldb.cpython-312-x86_64-linux-gnu.so 0x0000751c113ac4cb
10 _lldb.cpython-312-x86_64-linux-gnu.so 0x0000751c113ad37f
11 _lldb.cpython-312-x86_64-linux-gnu.so 0x0000751c113ad487
12 _lldb.cpython-312-x86_64-linux-gnu.so 0x0000751c113aed4e
13 _lldb.cpython-312-x86_64-linux-gnu.so 0x0000751c1140addf
14 _lldb.cpython-312-x86_64-linux-gnu.so 0x0000751c1180e278
15 _lldb.cpython-312-x86_64-linux-gnu.so 0x0000751c1138ba28
16 _lldb.cpython-312-x86_64-linux-gnu.so 0x0000751c1138bea3
17 _lldb.cpython-312-x86_64-linux-gnu.so 0x0000751c1138c3e3
18 _lldb.cpython-312-x86_64-linux-gnu.so 0x0000751c1125c17c
19 libc.so.6                             0x0000751c1889caa4
20 libc.so.6                             0x0000751c18929c3c
Fatal Python error: Segmentation fault
Thread 0x0000751c18b68080 (most recent call first):
  File "/home/buildbot/worker/as-builder-9/lldb-remote-linux-ubuntu/build/local/lib/python3.12/dist-packages/lldb/__init__.py", line 11494 in LoadCore
  File "/home/buildbot/worker/as-builder-9/lldb-remote-linux-ubuntu/llvm-project/lldb/test/API/functionalities/postmortem/minidump/TestMiniDump.py", line 43 in test_modules_in_mini_dump
  File "/usr/lib/python3.12/unittest/case.py", line 589 in _callTestMethod
  File "/usr/lib/python3.12/unittest/case.py", line 634 in run
  File "/usr/lib/python3.12/unittest/case.py", line 690 in __call__
  File "/usr/lib/python3.12/unittest/suite.py", line 122 in run
  File "/usr/lib/python3.12/unittest/suite.py", line 84 in __call__
  File "/usr/lib/python3.12/unittest/suite.py", line 122 in run
  File "/usr/lib/python3.12/unittest/suite.py", line 84 in __call__
  File "/usr/lib/python3.12/unittest/runner.py", line 240 in run
  File "/home/buildbot/worker/as-builder-9/lldb-remote-linux-ubuntu/llvm-project/lldb/packages/Python/lldbsuite/test/dotest.py", line 1108 in run_suite
  File "/home/buildbot/worker/as-builder-9/lldb-remote-linux-ubuntu/llvm-project/lldb/test/API/dotest.py", line 8 in <module>
Extension modules: lldb._lldb (total: 1)
  1. lldb-shell::broken-unwind.test:
Program arguments: /home/buildbot/worker/as-builder-9/lldb-remote-linux-ubuntu/build/bin/lldb -O "platform select remote-linux" -O "platform connect connect://jetson-agx-2198.lab.llvm.org:1234" -O "platform shell mkdir -p /home/ubuntu/lldb-tests/shell/home/ubuntu/lldb-tests/shell/Minidump/Windows/broken-unwind.test" -O "platform settings -w /home/ubuntu/lldb-tests/shell/home/ubuntu/lldb-tests/shell/Minidump/Windows/broken-unwind.test" --no-lldbinit -S /home/buildbot/worker/as-builder-9/lldb-remote-linux-ubuntu/build/tools/lldb/test/Shell/lit-lldb-init-quiet -O "settings set target.exec-search-paths /home/buildbot/worker/as-builder-9/lldb-remote-linux-ubuntu/build/tools/lldb/test/Shell/Minidump/Windows/Output" -c /home/buildbot/worker/as-builder-9/lldb-remote-linux-ubuntu/build/tools/lldb/test/Shell/Minidump/Windows/Output/broken-unwind.dmp -o "image show-unwind -a 0xb1000" -o exit
 #0 0x000063ebd3da85c2 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (/home/buildbot/worker/as-builder-9/lldb-remote-linux-ubuntu/build/bin/lldb+0x395c2)
 #1 0x000063ebd3da5d5f llvm::sys::RunSignalHandlers() (/home/buildbot/worker/as-builder-9/lldb-remote-linux-ubuntu/build/bin/lldb+0x36d5f)
 #2 0x000063ebd3da5ea4 SignalHandler(int, siginfo_t*, void*) Signals.cpp:0:0
 #3 0x00007cb82ca45330 (/lib/x86_64-linux-gnu/libc.so.6+0x45330)
 #4 0x00007cb82ca9eb2c pthread_kill (/lib/x86_64-linux-gnu/libc.so.6+0x9eb2c)
 #5 0x00007cb82ca4527e raise (/lib/x86_64-linux-gnu/libc.so.6+0x4527e)
 #6 0x00007cb82e43a553 SignalHandler(int, siginfo_t*, void*) Signals.cpp:0:0
 #7 0x00007cb82ca45330 (/lib/x86_64-linux-gnu/libc.so.6+0x45330)
 #8 0x00007cb82de575b7 lldb_private::RegisterContextUnwind::ReadFrameAddress(lldb::RegisterKind, lldb_private::UnwindPlan::Row::FAValue const&, unsigned long&) (/home/buildbot/worker/as-builder-9/lldb-remote-linux-ubuntu/build/lib/liblldb.so.21.0git+0xc575b7)
 #9 0x00007cb82de5ccd5 lldb_private::RegisterContextUnwind::InitializeZerothFrame() (/home/buildbot/worker/as-builder-9/lldb-remote-linux-ubuntu/build/lib/liblldb.so.21.0git+0xc5ccd5)
#10 0x00007cb82de5d473 lldb_private::RegisterContextUnwind::RegisterContextUnwind(lldb_private::Thread&, std::shared_ptr<lldb_private::RegisterContextUnwind> const&, lldb_private::SymbolContext&, unsigned int, lldb_private::UnwindLLDB&) (/home/buildbot/worker/as-builder-9/lldb-remote-linux-ubuntu/build/lib/liblldb.so.21.0git+0xc5d473)
#11 0x00007cb82de3bc4d lldb_private::UnwindLLDB::AddFirstFrame() (.part.0) UnwindLLDB.cpp:0:0
#12 0x00007cb82de3c535 lldb_private::UnwindLLDB::DoGetFrameInfoAtIndex(unsigned int, unsigned long&, unsigned long&, bool&) (/home/buildbot/worker/as-builder-9/lldb-remote-linux-ubuntu/build/lib/liblldb.so.21.0git+0xc3c535)
#13 0x00007cb82dda9f8b lldb_private::StackFrameList::FetchFramesUpTo(unsigned int, InterruptionControl) (/home/buildbot/worker/as-builder-9/lldb-remote-linux-ubuntu/build/lib/liblldb.so.21.0git+0xba9f8b)
#14 0x00007cb82ddaae3f lldb_private::StackFrameList::GetFramesUpTo(unsigned int, InterruptionControl) (/home/buildbot/worker/as-builder-9/lldb-remote-linux-ubuntu/build/lib/liblldb.so.21.0git+0xbaae3f)
#15 0x00007cb82ddaaf47 lldb_private::StackFrameList::GetFrameAtIndex(unsigned int) (/home/buildbot/worker/as-builder-9/lldb-remote-linux-ubuntu/build/lib/liblldb.so.21.0git+0xbaaf47)
#16 0x00007cb82ddac80e lldb_private::StackFrameList::SetDefaultFileAndLineToSelectedFrame() (/home/buildbot/worker/as-builder-9/lldb-remote-linux-ubuntu/build/lib/liblldb.so.21.0git+0xbac80e)
#17 0x00007cb82de0889f lldb_private::ThreadList::SetSelectedThreadByID(unsigned long, bool) (/home/buildbot/worker/as-builder-9/lldb-remote-linux-ubuntu/build/lib/liblldb.so.21.0git+0xc0889f)
#18 0x00007cb82dd8000e lldb_private::Process::HandleProcessStateChangedEvent(std::shared_ptr<lldb_private::Event> const&, lldb_private::Stream*, SelectMostRelevant, bool&) (/home/buildbot/worker/as-builder-9/lldb-remote-linux-ubuntu/build/lib/liblldb.so.21.0git+0xb8000e)
#19 0x00007cb82dd80480 lldb_private::Process::WaitForProcessToStop(lldb_private::Timeout<std::ratio<1l, 1000000l>> const&, std::shared_ptr<lldb_private::Event>*, bool, std::shared_ptr<lldb_private::Listener>, lldb_private::Stream*, bool, SelectMostRelevant) (/home/buildbot/worker/as-builder-9/lldb-remote-linux-ubuntu/build/lib/liblldb.so.21.0git+0xb80480)
#20 0x00007cb82dd833da lldb_private::Process::LoadCore() (/home/buildbot/worker/as-builder-9/lldb-remote-linux-ubuntu/build/lib/liblldb.so.21.0git+0xb833da)
#21 0x00007cb82efb09ba CommandObjectTargetCreate::DoExecute(lldb_private::Args&, lldb_private::CommandReturnObject&) (/home/buildbot/worker/as-builder-9/lldb-remote-linux-ubuntu/build/lib/liblldb.so.21.0git+0x1db09ba)
#22 0x00007cb82dc8414d lldb_private::CommandObjectParsed::Execute(char const*, lldb_private::CommandReturnObject&) (/home/buildbot/worker/as-builder-9/lldb-remote-linux-ubuntu/build/lib/liblldb.so.21.0git+0xa8414d)
#23 0x00007cb82dc7de69 lldb_private::CommandInterpreter::HandleCommand(char const*, lldb_private::LazyBool, lldb_private::CommandReturnObject&, bool) (/home/buildbot/worker/as-builder-9/lldb-remote-linux-ubuntu/build/lib/liblldb.so.21.0git+0xa7de69)
#24 0x00007cb82dc7e7b6 lldb_private::CommandInterpreter::IOHandlerInputComplete(lldb_private::IOHandler&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>&) (/home/buildbot/worker/as-builder-9/lldb-remote-linux-ubuntu/build/lib/liblldb.so.21.0git+0xa7e7b6)
#25 0x00007cb82db83e5c lldb_private::IOHandlerEditline::Run() (/home/buildbot/worker/as-builder-9/lldb-remote-linux-ubuntu/build/lib/liblldb.so.21.0git+0x983e5c)
#26 0x00007cb82db50bc1 lldb_private::Debugger::RunIOHandlers() (/home/buildbot/worker/as-builder-9/lldb-remote-linux-ubuntu/build/lib/liblldb.so.21.0git+0x950bc1)
#27 0x00007cb82dc6ac16 lldb_private::CommandInterpreter::RunCommandInterpreter(lldb_private::CommandInterpreterRunOptions&) (/home/buildbot/worker/as-builder-9/lldb-remote-linux-ubuntu/build/lib/liblldb.so.21.0git+0xa6ac16)
#28 0x00007cb82d8d058c lldb::SBDebugger::RunCommandInterpreter(lldb::SBCommandInterpreterRunOptions const&) (/home/buildbot/worker/as-builder-9/lldb-remote-linux-ubuntu/build/lib/liblldb.so.21.0git+0x6d058c)
#29 0x000063ebd3d81793 Driver::MainLoop() (/home/buildbot/worker/as-builder-9/lldb-remote-linux-ubuntu/build/bin/lldb+0x12793)
#30 0x000063ebd3d7e874 main (/home/buildbot/worker/as-builder-9/lldb-remote-linux-ubuntu/build/bin/lldb+0xf874)
#31 0x00007cb82ca2a1ca (/lib/x86_64-linux-gnu/libc.so.6+0x2a1ca)
#32 0x00007cb82ca2a28b __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x2a28b)
#33 0x000063ebd3d7eb35 _start (/home/buildbot/worker/as-builder-9/lldb-remote-linux-ubuntu/build/bin/lldb+0xfb35)
/home/buildbot/worker/as-builder-9/lldb-remote-linux-ubuntu/build/tools/lldb/test/Shell/Minidump/Windows/Output/
broken-unwind.test.script: line 3: 3769789 Segmentation fault      (core dumped) 
/home/buildbot/worker/as-builder-9/lldb-remote-linux-ubuntu/build/bin/lldb -O "platform select remote-linux" -O "platform connect connect://jetson-agx-2198.lab.llvm.org:1234" -O "platform shell mkdir -p /home/ubuntu/lldb-tests/shell/home/ubuntu/lldb-tests/shell/Minidump/Windows/broken-unwind.test" -O "platform settings -w /home/ubuntu/lldb-tests/shell/home/ubuntu/lldb-tests/shell/Minidump/Windows/broken-unwind.test" --no-lldbinit -S /home/buildbot/worker/as-builder-9/lldb-remote-linux-ubuntu/build/tools/lldb/test/Shell/lit-lldb-init-quiet -O "settings set target.exec-search-paths /home/buildbot/worker/as-builder-9/lldb-remote-linux-ubuntu/build/tools/lldb/test/Shell/Minidump/Windows/Output" -c /home/buildbot/worker/as-builder-9/lldb-remote-linux-ubuntu/build/tools/lldb/test/Shell/Minidump/Windows/Output/broken-unwind.dmp -o "image show-unwind -a 0xb1000" -o exit

dzhidzhoev added a commit that referenced this pull request Apr 3, 2025
labath added a commit that referenced this pull request Apr 3, 2025
It's value is not set on all control flow paths. I believe this should
fix the failure on some buildbots after #133247.
labath added a commit to labath/llvm-project that referenced this pull request Apr 3, 2025
This reverts commit 0949043, reapplying
d7afafd (llvm#133247).

The failure ought to be fixed by
0509932.
labath added a commit that referenced this pull request Apr 4, 2025
… " (#134246)

This reverts commit 0949043, reapplying
d7afafd (#133247).

The failure ought to be fixed by
0509932.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants