[Lldb-commits] [lldb] r118467 - in /lldb/trunk: include/lldb/Symbol/FuncUnwinders.h source/Plugins/Process/Utility/RegisterContextLLDB.cpp source/Plugins/Process/Utility/UnwindLLDB.h source/Symbol/UnwindTable.cpp

Jason Molenda jmolenda at apple.com
Mon Nov 8 17:21:22 PST 2010


Author: jmolenda
Date: Mon Nov  8 19:21:22 2010
New Revision: 118467

URL: http://llvm.org/viewvc/llvm-project?rev=118467&view=rev
Log:
Fix thinko in UnwindTable.cpp where it wouldn't provde a 
FuncUnwinders object if the eh_frame section was missing
from an objfile.  Worked fine on x86_64 but on i386 where
eh_frame is unusual, that resulted in the arch default 
UnwindPlan being used all the time instead of picking up
an assembly profile based unwindplan.


Modified:
    lldb/trunk/include/lldb/Symbol/FuncUnwinders.h
    lldb/trunk/source/Plugins/Process/Utility/RegisterContextLLDB.cpp
    lldb/trunk/source/Plugins/Process/Utility/UnwindLLDB.h
    lldb/trunk/source/Symbol/UnwindTable.cpp

Modified: lldb/trunk/include/lldb/Symbol/FuncUnwinders.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Symbol/FuncUnwinders.h?rev=118467&r1=118466&r2=118467&view=diff
==============================================================================
--- lldb/trunk/include/lldb/Symbol/FuncUnwinders.h (original)
+++ lldb/trunk/include/lldb/Symbol/FuncUnwinders.h Mon Nov  8 19:21:22 2010
@@ -61,8 +61,8 @@
         return m_range.ContainsFileAddress (addr);
     }
 
-protected:
 
+private:
     UnwindTable& m_unwind_table;
     UnwindAssemblyProfiler *m_assembly_profiler;
     AddressRange m_range;

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=118467&r1=118466&r2=118467&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/Process/Utility/RegisterContextLLDB.cpp (original)
+++ lldb/trunk/source/Plugins/Process/Utility/RegisterContextLLDB.cpp Mon Nov  8 19:21:22 2010
@@ -764,9 +764,14 @@
             {
                 if (log)
                 {
-                    log->Printf("%*sFrame %d could not convert lldb regnum %d into %d RegisterKind reg numbering scheme",
-                                m_frame_number < 100 ? m_frame_number : 100, "", m_frame_number,
-                                lldb_regnum, (int) unwindplan_registerkind);
+                    if (unwindplan_registerkind == eRegisterKindGeneric)
+                        log->Printf("%*sFrame %d could not convert lldb regnum %d into eRegisterKindGeneric reg numbering scheme",
+                                    m_frame_number < 100 ? m_frame_number : 100, "", m_frame_number,
+                                    lldb_regnum);
+                    else
+                        log->Printf("%*sFrame %d could not convert lldb regnum %d into %d RegisterKind reg numbering scheme",
+                                    m_frame_number < 100 ? m_frame_number : 100, "", m_frame_number,
+                                    lldb_regnum, (int) unwindplan_registerkind);
                 }
                 return false;
             }

Modified: lldb/trunk/source/Plugins/Process/Utility/UnwindLLDB.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/Utility/UnwindLLDB.h?rev=118467&r1=118466&r2=118467&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/Process/Utility/UnwindLLDB.h (original)
+++ lldb/trunk/source/Plugins/Process/Utility/UnwindLLDB.h Mon Nov  8 19:21:22 2010
@@ -56,6 +56,7 @@
         lldb::RegisterContextSP reg_ctx; // These are all RegisterContextLLDB's
 
         Cursor () : start_pc (LLDB_INVALID_ADDRESS), cfa (LLDB_INVALID_ADDRESS), sctx(), reg_ctx() { }
+    private:
         DISALLOW_COPY_AND_ASSIGN (Cursor);
     };
 

Modified: lldb/trunk/source/Symbol/UnwindTable.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Symbol/UnwindTable.cpp?rev=118467&r1=118466&r2=118467&view=diff
==============================================================================
--- lldb/trunk/source/Symbol/UnwindTable.cpp (original)
+++ lldb/trunk/source/Symbol/UnwindTable.cpp Mon Nov  8 19:21:22 2010
@@ -77,11 +77,6 @@
 
     initialize();
 
-    if (m_eh_frame == NULL)
-    {
-        return no_unwind_found;
-    }
-
     // Create a FuncUnwinders object for the binary search below
     AddressRange search_range(addr, 1);
     FuncUnwindersSP search_unwind(new FuncUnwinders (*this, NULL, search_range));
@@ -111,7 +106,7 @@
     if (!sc.GetAddressRange(eSymbolContextFunction | eSymbolContextSymbol, range) || !range.GetBaseAddress().IsValid())
     {
         // Does the eh_frame unwind info has a function bounds for this addr?
-        if (!m_eh_frame->GetAddressRange (addr, range))
+        if (m_eh_frame == NULL || !m_eh_frame->GetAddressRange (addr, range))
         {
             return no_unwind_found;
         }





More information about the lldb-commits mailing list