[Lldb-commits] [lldb] r126248 - /lldb/branches/apple/calcite/lldb/source/Plugins/Process/Utility/RegisterContextLLDB.cpp

Greg Clayton gclayton at apple.com
Tue Feb 22 13:21:04 PST 2011


Author: gclayton
Date: Tue Feb 22 15:21:04 2011
New Revision: 126248

URL: http://llvm.org/viewvc/llvm-project?rev=126248&view=rev
Log:
<rdar://problem/9037286> assertion can cause LLDB to crash when doing backtraces


Modified:
    lldb/branches/apple/calcite/lldb/source/Plugins/Process/Utility/RegisterContextLLDB.cpp

Modified: lldb/branches/apple/calcite/lldb/source/Plugins/Process/Utility/RegisterContextLLDB.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/apple/calcite/lldb/source/Plugins/Process/Utility/RegisterContextLLDB.cpp?rev=126248&r1=126247&r2=126248&view=diff
==============================================================================
--- lldb/branches/apple/calcite/lldb/source/Plugins/Process/Utility/RegisterContextLLDB.cpp (original)
+++ lldb/branches/apple/calcite/lldb/source/Plugins/Process/Utility/RegisterContextLLDB.cpp Tue Feb 22 15:21:04 2011
@@ -113,8 +113,18 @@
     if (addr_range.GetBaseAddress().IsValid())
     {
         m_start_pc = addr_range.GetBaseAddress();
-        assert (frame_sp->GetFrameCodeAddress().GetSection() == m_start_pc.GetSection());
-        m_current_offset = frame_sp->GetFrameCodeAddress().GetOffset() - m_start_pc.GetOffset();
+        if (frame_sp->GetFrameCodeAddress().GetSection() == m_start_pc.GetSection())
+        {
+            m_current_offset = frame_sp->GetFrameCodeAddress().GetOffset() - m_start_pc.GetOffset();
+        }
+        else if (frame_sp->GetFrameCodeAddress().GetModule() == m_start_pc.GetModule())
+        {
+            // This means that whatever symbol we kicked up isn't really correct
+            // as no should cross section boundaries... We really should NULL out
+            // the function/symbol in this case unless there is a bad assumption
+            // here due to inlined functions?
+            m_current_offset = frame_sp->GetFrameCodeAddress().GetFileAddress() - m_start_pc.GetFileAddress();
+        }
         m_current_offset_backed_up_one = m_current_offset;
     }
     else





More information about the lldb-commits mailing list