From 881ec8534e424dacdcad6346409104060145bfe2 Mon Sep 17 00:00:00 2001 From: Jim Ingham Date: Fri, 7 Oct 2011 22:20:35 +0000 Subject: [PATCH] When a function calculates its module, make sure it returns the "real" module, not the linked .o file. llvm-svn: 141424 --- lldb/source/Symbol/Function.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/lldb/source/Symbol/Function.cpp b/lldb/source/Symbol/Function.cpp index 8ce275852c5b..11480f7c086e 100644 --- a/lldb/source/Symbol/Function.cpp +++ b/lldb/source/Symbol/Function.cpp @@ -387,6 +387,16 @@ Function::CalculateSymbolContext(SymbolContext* sc) 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(); }