[Lldb-commits] [lldb] r226631 - Adding compact unwind as a source of unwind information

Jason Molenda jmolenda at apple.com
Tue Jan 20 17:26:29 PST 2015


Author: jmolenda
Date: Tue Jan 20 19:26:28 2015
New Revision: 226631

URL: http://llvm.org/viewvc/llvm-project?rev=226631&view=rev
Log:
Adding compact unwind as a source of unwind information 
introduced subtle bugs in two places in 
RegisterContextLLDB::GetFullUnwindPlanForFrame where 
it specifically wanted to get an eh_frame unwind plan
and was using "Get CallSite UnwindPlan" as synonymous
with that.  But now we have two different types of 
unwind plan that can be returned in that case, and
compact unwind won't behaves as needed.

<rdar://problem/19528559> 

Modified:
    lldb/trunk/source/Plugins/Process/Utility/RegisterContextLLDB.cpp

Modified: lldb/trunk/source/Plugins/Process/Utility/RegisterContextLLDB.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/Utility/RegisterContextLLDB.cpp?rev=226631&r1=226630&r2=226631&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/Process/Utility/RegisterContextLLDB.cpp (original)
+++ lldb/trunk/source/Plugins/Process/Utility/RegisterContextLLDB.cpp Tue Jan 20 19:26:28 2015
@@ -811,7 +811,7 @@ RegisterContextLLDB::GetFullUnwindPlanFo
     if (m_frame_type == eTrapHandlerFrame && process)
     {
         m_fast_unwind_plan_sp.reset();
-        unwind_plan_sp = func_unwinders_sp->GetUnwindPlanAtCallSite (process->GetTarget(), m_current_offset_backed_up_one);
+        unwind_plan_sp = func_unwinders_sp->GetEHFrameUnwindPlan (process->GetTarget(), m_current_offset_backed_up_one);
         if (unwind_plan_sp && unwind_plan_sp->PlanValidAtAddress (m_current_pc) && unwind_plan_sp->GetSourcedFromCompiler() == eLazyBoolYes)
         {
             return unwind_plan_sp;
@@ -826,7 +826,10 @@ RegisterContextLLDB::GetFullUnwindPlanFo
     // But there is not.
     if (process && process->GetDynamicLoader() && process->GetDynamicLoader()->AlwaysRelyOnEHUnwindInfo (m_sym_ctx))
     {
-        unwind_plan_sp = func_unwinders_sp->GetUnwindPlanAtCallSite (process->GetTarget(), m_current_offset_backed_up_one);
+        // We must specifically call the GetEHFrameUnwindPlan() method here -- normally we would
+        // call GetUnwindPlanAtCallSite() -- because CallSite may return an unwind plan sourced from
+        // either eh_frame (that's what we intend) or compact unwind (this won't work)
+        unwind_plan_sp = func_unwinders_sp->GetEHFrameUnwindPlan (process->GetTarget(), m_current_offset_backed_up_one);
         if (unwind_plan_sp && unwind_plan_sp->PlanValidAtAddress (m_current_pc))
         {
             UnwindLogMsgVerbose ("frame uses %s for full UnwindPlan because the DynamicLoader suggested we prefer it",





More information about the lldb-commits mailing list