[Lldb-commits] [lldb] r122386 - in /lldb/trunk/source: Plugins/Process/Utility/RegisterContextLLDB.cpp Target/SectionLoadList.cpp

Jason Molenda jmolenda at apple.com
Tue Dec 21 18:02:45 PST 2010


Author: jmolenda
Date: Tue Dec 21 20:02:45 2010
New Revision: 122386

URL: http://llvm.org/viewvc/llvm-project?rev=122386&view=rev
Log:
RegisterContextLLDB.cpp (InitializeNonZerothFrame): If we get a
0 mid-stack, stop backtracing.

SectionLoadList.cpp (ResolveLoadAddress): Don't assert on an
out-of-range address, just return an invalid Address object.
The unwinder may be passing in invalid addresses on the final
stack frame and the assert is a problem.

Modified:
    lldb/trunk/source/Plugins/Process/Utility/RegisterContextLLDB.cpp
    lldb/trunk/source/Target/SectionLoadList.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=122386&r1=122385&r2=122386&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/Process/Utility/RegisterContextLLDB.cpp (original)
+++ lldb/trunk/source/Plugins/Process/Utility/RegisterContextLLDB.cpp Tue Dec 21 20:02:45 2010
@@ -210,6 +210,12 @@
         m_frame_type = eNotAValidFrame;
         return;
     }
+    // A pc value of 0 up on the stack indicates we've hit the end of the stack
+    if (pc == 0)
+    {
+        m_frame_type = eNotAValidFrame;
+        return;
+    }
     m_thread.GetProcess().GetTarget().GetSectionLoadList().ResolveLoadAddress (pc, m_current_pc);
 
     // If we don't have a Module for some reason, we're not going to find symbol/function information - just

Modified: lldb/trunk/source/Target/SectionLoadList.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Target/SectionLoadList.cpp?rev=122386&r1=122385&r2=122386&view=diff
==============================================================================
--- lldb/trunk/source/Target/SectionLoadList.cpp (original)
+++ lldb/trunk/source/Target/SectionLoadList.cpp Tue Dec 21 20:02:45 2010
@@ -164,13 +164,15 @@
     {
         if (load_addr != pos->first && pos != m_collection.begin())
             --pos;
-        assert (load_addr >= pos->first);
-        addr_t offset = load_addr - pos->first;
-        if (offset < pos->second->GetByteSize())
+        if (load_addr >= pos->first)
         {
-            // We have found the top level section, now we need to find the
-            // deepest child section.
-            return pos->second->ResolveContainedAddress (offset, so_addr);
+            addr_t offset = load_addr - pos->first;
+            if (offset < pos->second->GetByteSize())
+            {
+                // We have found the top level section, now we need to find the
+                // deepest child section.
+                return pos->second->ResolveContainedAddress (offset, so_addr);
+            }
         }
     }
     so_addr.Clear();





More information about the lldb-commits mailing list