[Lldb-commits] [lldb] r141894 - in /lldb/trunk/source: Expression/ClangExpressionDeclMap.cpp Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp

Sean Callanan scallanan at apple.com
Thu Oct 13 14:50:33 PDT 2011


Author: spyffe
Date: Thu Oct 13 16:50:33 2011
New Revision: 141894

URL: http://llvm.org/viewvc/llvm-project?rev=141894&view=rev
Log:
Enabled the namespace-specific search functionality,
which had previously been commented out while I tested
it.  It's not fully working yet, but it doesn't break
our testsuite and it's an important piece of
functionality.

Also added some logging to SymbolFileDWARF to help
diagnose entities that are found in a symbol file,
but do not reside in the expected namespace.

Modified:
    lldb/trunk/source/Expression/ClangExpressionDeclMap.cpp
    lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp

Modified: lldb/trunk/source/Expression/ClangExpressionDeclMap.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Expression/ClangExpressionDeclMap.cpp?rev=141894&r1=141893&r2=141894&view=diff
==============================================================================
--- lldb/trunk/source/Expression/ClangExpressionDeclMap.cpp (original)
+++ lldb/trunk/source/Expression/ClangExpressionDeclMap.cpp Thu Oct 13 16:50:33 2011
@@ -2070,10 +2070,10 @@
                             i->second.GetNamespaceDecl()->getNameAsString().c_str(),
                             i->first->GetFileSpec().GetFilename().GetCString());
                 
-            //FindExternalVisibleDecls(context,
-            //                         i->first,
-            //                         i->second,
-            //                         name);
+            FindExternalVisibleDecls(context,
+                                     i->first,
+                                     i->second,
+                                     name);
         }
     }
     else if (!isa<TranslationUnitDecl>(context.m_decl_context))

Modified: lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp?rev=141894&r1=141893&r2=141894&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp (original)
+++ lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp Thu Oct 13 16:50:33 2011
@@ -1982,6 +1982,8 @@
     // No namespace specified, so the answesr i
     if (namespace_decl == NULL)
         return true;
+    
+    LogSP log (LogChannelDWARF::GetLogIfAll(DWARF_LOG_LOOKUPS));
 
     const DWARFDebugInfoEntry *decl_ctx_die = GetDeclContextDIEContainingDIE (cu, die);
     if (decl_ctx_die)
@@ -1991,12 +1993,21 @@
         if (clang_namespace_decl)
         {
             if (decl_ctx_die->Tag() != DW_TAG_namespace)
+            {
+                if (log)
+                    log->Printf("Found a match, but its parent is not a namespace");
                 return false;
-
+            }
+                
             DeclContextToDIEMap::iterator pos = m_decl_ctx_to_die.find(clang_namespace_decl);
             
             if (pos == m_decl_ctx_to_die.end())
+            {
+                if (log)
+                    log->Printf("Found a match in a namespace, but its parent is not the requested namespace");
+                
                 return false;
+            }
             
             return decl_ctx_die == pos->second;
         }
@@ -2010,6 +2021,10 @@
                 return true;
         }
     }
+    
+    if (log)
+        log->Printf("Found a match, but its parent doesn't exist");
+    
     return false;
 }
 uint32_t





More information about the lldb-commits mailing list