[Lldb-commits] [lldb] r216412 - Have augment_unwind_plan_from_call_site update the UnwindPlan

Jason Molenda jmolenda at apple.com
Mon Aug 25 15:16:23 PDT 2014


Author: jmolenda
Date: Mon Aug 25 17:16:23 2014
New Revision: 216412

URL: http://llvm.org/viewvc/llvm-project?rev=216412&view=rev
Log:
Have augment_unwind_plan_from_call_site update the UnwindPlan 
name/from-compiler settings to indicate that it was augmented
by assembly profiling.

Modified:
    lldb/trunk/source/Plugins/UnwindAssembly/x86/UnwindAssembly-x86.cpp
    lldb/trunk/source/Symbol/FuncUnwinders.cpp

Modified: lldb/trunk/source/Plugins/UnwindAssembly/x86/UnwindAssembly-x86.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/UnwindAssembly/x86/UnwindAssembly-x86.cpp?rev=216412&r1=216411&r2=216412&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/UnwindAssembly/x86/UnwindAssembly-x86.cpp (original)
+++ lldb/trunk/source/Plugins/UnwindAssembly/x86/UnwindAssembly-x86.cpp Mon Aug 25 17:16:23 2014
@@ -876,6 +876,7 @@ AssemblyParse_x86::augment_unwind_plan_f
     m_cur_insn = func.GetBaseAddress();
     uint64_t offset = 0;
     int row_id = 1;
+    bool unwind_plan_updated = false;
     UnwindPlan::RowSP row(new UnwindPlan::Row(*first_row));
     while (func.ContainsFileAddress (m_cur_insn))
     {
@@ -935,6 +936,7 @@ AssemblyParse_x86::augment_unwind_plan_f
 
                 UnwindPlan::RowSP new_row(new UnwindPlan::Row(*row));
                 unwind_plan.InsertRow (new_row);
+                unwind_plan_updated = true;
                 continue;
             }
 
@@ -946,6 +948,7 @@ AssemblyParse_x86::augment_unwind_plan_f
 
                 UnwindPlan::RowSP new_row(new UnwindPlan::Row(*row));
                 unwind_plan.InsertRow (new_row);
+                unwind_plan_updated = true;
                 continue;
             }
             if (pop_reg_p (regno)) {
@@ -959,6 +962,7 @@ AssemblyParse_x86::augment_unwind_plan_f
 
                 UnwindPlan::RowSP new_row(new UnwindPlan::Row(*row));
                 unwind_plan.InsertRow (new_row);
+                unwind_plan_updated = true;
                 continue;
             }
 
@@ -968,6 +972,7 @@ AssemblyParse_x86::augment_unwind_plan_f
                 row->SetCFAOffset (m_wordsize + row->GetCFAOffset());
                 UnwindPlan::RowSP new_row(new UnwindPlan::Row(*row));
                 unwind_plan.InsertRow (new_row);
+                unwind_plan_updated = true;
                 continue;
             }
 
@@ -979,6 +984,7 @@ AssemblyParse_x86::augment_unwind_plan_f
 
                 UnwindPlan::RowSP new_row(new UnwindPlan::Row(*row));
                 unwind_plan.InsertRow (new_row);
+                unwind_plan_updated = true;
                 continue;
             }
             if (sub_rsp_pattern_p (amount)) {
@@ -987,6 +993,7 @@ AssemblyParse_x86::augment_unwind_plan_f
 
                 UnwindPlan::RowSP new_row(new UnwindPlan::Row(*row));
                 unwind_plan.InsertRow (new_row);
+                unwind_plan_updated = true;
                 continue;
             }
         }
@@ -1009,6 +1016,7 @@ AssemblyParse_x86::augment_unwind_plan_f
 
                     UnwindPlan::RowSP new_row(new UnwindPlan::Row(*row));
                     unwind_plan.InsertRow (new_row);
+                    unwind_plan_updated = true;
                     continue;
                 }
             }
@@ -1024,6 +1032,13 @@ AssemblyParse_x86::augment_unwind_plan_f
     }
 
     unwind_plan.SetPlanValidAddressRange (func);
+    if (unwind_plan_updated)
+    {
+        std::string unwind_plan_source (unwind_plan.GetSourceName().AsCString());
+        unwind_plan_source += " plus augmentation from assembly parsing";
+        unwind_plan.SetSourceName (unwind_plan_source.c_str());
+        unwind_plan.SetSourcedFromCompiler (eLazyBoolNo);
+    }
     return true;
 }
 

Modified: lldb/trunk/source/Symbol/FuncUnwinders.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Symbol/FuncUnwinders.cpp?rev=216412&r1=216411&r2=216412&view=diff
==============================================================================
--- lldb/trunk/source/Symbol/FuncUnwinders.cpp (original)
+++ lldb/trunk/source/Symbol/FuncUnwinders.cpp Mon Aug 25 17:16:23 2014
@@ -115,7 +115,8 @@ FuncUnwinders::GetUnwindPlanAtNonCallSit
         if (assembly_profiler_sp)
         {
             if (target.GetArchitecture().GetCore() == ArchSpec::eCore_x86_32_i386
-                || target.GetArchitecture().GetCore() == ArchSpec::eCore_x86_64_x86_64)
+                || target.GetArchitecture().GetCore() == ArchSpec::eCore_x86_64_x86_64
+                || target.GetArchitecture().GetCore() == ArchSpec::eCore_x86_64_x86_64h)
             {
                 // For 0th frame on i386 & x86_64, we fetch eh_frame and try using assembly profiler
                 // to augment it into asynchronous unwind table.





More information about the lldb-commits mailing list