[Lldb-commits] [lldb] r141424 - /lldb/trunk/source/Symbol/Function.cpp

Jim Ingham jingham at apple.com
Fri Oct 7 15:20:35 PDT 2011


Author: jingham
Date: Fri Oct  7 17:20:35 2011
New Revision: 141424

URL: http://llvm.org/viewvc/llvm-project?rev=141424&view=rev
Log:
When a function calculates its module, make sure it returns the "real" module, not the linked .o file.

Modified:
    lldb/trunk/source/Symbol/Function.cpp

Modified: lldb/trunk/source/Symbol/Function.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Symbol/Function.cpp?rev=141424&r1=141423&r2=141424&view=diff
==============================================================================
--- lldb/trunk/source/Symbol/Function.cpp (original)
+++ lldb/trunk/source/Symbol/Function.cpp Fri Oct  7 17:20:35 2011
@@ -387,6 +387,16 @@
 Module *
 Function::CalculateSymbolContextModule ()
 {
+    const Section *section = m_range.GetBaseAddress().GetSection();
+    if (section)
+    {
+        const Section *linked_section = section->GetLinkedSection();
+        if (linked_section)
+            return linked_section->GetModule();
+        else
+            return section->GetModule();
+    }
+    
     return this->GetCompileUnit()->GetModule();
 }
 





More information about the lldb-commits mailing list