summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGreg Clayton <gclayton@apple.com>2012-04-20 20:35:47 +0000
committerGreg Clayton <gclayton@apple.com>2012-04-20 20:35:47 +0000
commit9bbddbf84abc962972b2a5d2fcad33eacb313815 (patch)
tree02d00731baafc5e4cf1c16488b7163c9253c7182
parent91adf295f5af1975cfcecd275cbc7e81d05a8de7 (diff)
downloadbcm5719-llvm-9bbddbf84abc962972b2a5d2fcad33eacb313815.tar.gz
bcm5719-llvm-9bbddbf84abc962972b2a5d2fcad33eacb313815.zip
Added logging so we can see when we are trying to complete a forward type and pull in the world. This is due to a compiler bug we are tracking (<rdar://problem/11291658>) where forward decls to classes and types are not properly scoped in namespaces, which results in the current LLDB looking for a type it will find many times in the accelerator tables, but never match. For example, when debugging with clang we get a forward decl like:
class AnalysisResolver; And we will look for it everywhere and find many many matches, but the decl context of those matching DIEs is "clang::AnalysisResolver", so we never match anything, yet we pull in waaayyy too much DWARF in the process. To enable this logging enable the "lookups" category in the "dwarf" log channel: (lldb) log enable dwarf lookups llvm-svn: 155233
-rw-r--r--lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp38
1 files changed, 38 insertions, 0 deletions
diff --git a/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp b/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
index eee1118fed8..8372bec356b 100644
--- a/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
+++ b/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
@@ -4561,6 +4561,18 @@ SymbolFileDWARF::FindDefinitionTypeForDIE (DWARFCompileUnit* cu,
if (cu == NULL || die == NULL || !type_name)
return type_sp;
+ LogSP log (LogChannelDWARF::GetLogIfAny(DWARF_LOG_TYPE_COMPLETION|DWARF_LOG_LOOKUPS));
+ if (log)
+ {
+ std::string qualified_name;
+ die->GetQualifiedName(this, cu, qualified_name);
+ GetObjectFile()->GetModule()->LogMessage (log.get(),
+ "SymbolFileDWARF::FindDefinitionTypeForDIE(die=0x%8.8x (%s), name='%s')",
+ die->GetOffset(),
+ qualified_name.c_str(),
+ type_name.GetCString());
+ }
+
DIEArray die_offsets;
if (m_using_apple_tables)
@@ -4639,6 +4651,18 @@ SymbolFileDWARF::FindDefinitionTypeForDIE (DWARFCompileUnit* cu,
if (try_resolving_type)
{
+ if (log)
+ {
+ std::string qualified_name;
+ type_die->GetQualifiedName(this, cu, qualified_name);
+ GetObjectFile()->GetModule()->LogMessage (log.get(),
+ "SymbolFileDWARF::FindDefinitionTypeForDIE(die=0x%8.8x, name='%s') trying die=0x%8.8x (%s)",
+ die->GetOffset(),
+ type_name.GetCString(),
+ type_die->GetOffset(),
+ qualified_name.c_str());
+ }
+
// Make sure the decl contexts match all the way up
if (DIEDeclContextsMatch(cu, die, type_cu, type_die))
{
@@ -4658,6 +4682,20 @@ SymbolFileDWARF::FindDefinitionTypeForDIE (DWARFCompileUnit* cu,
}
}
}
+ else
+ {
+ if (log)
+ {
+ std::string qualified_name;
+ type_die->GetQualifiedName(this, cu, qualified_name);
+ GetObjectFile()->GetModule()->LogMessage (log.get(),
+ "SymbolFileDWARF::FindDefinitionTypeForDIE(die=0x%8.8x, name='%s') ignoring die=0x%8.8x (%s)",
+ die->GetOffset(),
+ type_name.GetCString(),
+ type_die->GetOffset(),
+ qualified_name.c_str());
+ }
+ }
}
else
{
OpenPOWER on IntegriCloud