[Lldb-commits] [lldb] r116558 - in /lldb/trunk/source/Plugins/SymbolFile/DWARF: DWARFCompileUnit.cpp DWARFCompileUnit.h SymbolFileDWARF.cpp SymbolFileDWARF.h

Greg Clayton gclayton at apple.com
Thu Oct 14 19:03:22 PDT 2010


Author: gclayton
Date: Thu Oct 14 21:03:22 2010
New Revision: 116558

URL: http://llvm.org/viewvc/llvm-project?rev=116558&view=rev
Log:
Separated the DWARF index for types from that the index of the namespaces
since we can't parse DW_TAG_namespace DIEs as types. They are only decls in
clang. All of the types we handle right now have both clang "XXXType" classes
to go with the "XXXDecl" classes which means they can be used within the 
lldb_private::Type class. I need to check to see which other decls that don't
have associated type objects need to float around the debugger and possibly
make a lldb_private::Decl class to manage them.



Modified:
    lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFCompileUnit.cpp
    lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFCompileUnit.h
    lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
    lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.h

Modified: lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFCompileUnit.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFCompileUnit.cpp?rev=116558&r1=116557&r2=116558&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFCompileUnit.cpp (original)
+++ lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFCompileUnit.cpp Thu Oct 14 21:03:22 2010
@@ -571,6 +571,7 @@
     NameToDIE& objc_class_selector_dies,
     NameToDIE& name_to_global_die,
     NameToDIE& name_to_type_die,
+    NameToDIE& name_to_namespace_die,
     const DWARFDebugRanges *debug_ranges,
     DWARFDebugAranges *aranges
 )
@@ -874,13 +875,17 @@
         case DW_TAG_structure_type:
         case DW_TAG_union_type:
         case DW_TAG_typedef:
-        case DW_TAG_namespace:
             if (name && is_declaration == false)
             {
                 name_to_type_die.Insert (ConstString(name), die_info);
             }
             break;
 
+        case DW_TAG_namespace:
+            if (name)
+                name_to_namespace_die.Insert (ConstString(name), die_info);
+            break;
+
         case DW_TAG_variable:
             if (name && has_location && is_global_or_static_variable)
             {

Modified: lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFCompileUnit.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFCompileUnit.h?rev=116558&r1=116557&r2=116558&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFCompileUnit.h (original)
+++ lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFCompileUnit.h Thu Oct 14 21:03:22 2010
@@ -141,6 +141,7 @@
            NameToDIE& objc_class_selector_dies,
            NameToDIE& name_to_global_die,
            NameToDIE& name_to_type_die,
+           NameToDIE& name_to_namespace_die,
            const DWARFDebugRanges* debug_ranges,
            DWARFDebugAranges *aranges);
 

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=116558&r1=116557&r2=116558&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp (original)
+++ lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp Thu Oct 14 21:03:22 2010
@@ -163,7 +163,8 @@
     m_function_selector_index(),
     m_objc_class_selectors_index(),
     m_global_index(),
-    m_types_index(),
+    m_type_index(),
+    m_namespace_index(),
     m_indexed(false),
     m_ranges()
 {
@@ -1718,7 +1719,8 @@
                        m_function_selector_index,
                        m_objc_class_selectors_index,
                        m_global_index, 
-                       m_types_index,
+                       m_type_index,
+                       m_namespace_index,
                        DebugRanges(),
                        m_aranges.get());  
             
@@ -1742,7 +1744,9 @@
         s.Printf("\nFunction selectors:\n");    m_function_selector_index.Dump (&s);
         s.Printf("\nObjective C class selectors:\n");    m_objc_class_selectors_index.Dump (&s);
         s.Printf("\nGlobals and statics:\n");   m_global_index.Dump (&s); 
-        s.Printf("\nTypes:\n");                 m_types_index.Dump (&s);
+        s.Printf("\nTypes:\n");                 m_type_index.Dump (&s);
+        s.Printf("\nNamepaces:\n");             m_namespace_index.Dump (&s);
+        
 #endif
     }
 }
@@ -2033,7 +2037,7 @@
     DWARFCompileUnit* prev_cu = NULL;
     const DWARFDebugInfoEntry* die = NULL;
     std::vector<NameToDIE::Info> die_info_array;
-    const size_t num_matches = m_types_index.Find (name, die_info_array);
+    const size_t num_matches = m_type_index.Find (name, die_info_array);
     for (size_t i=0; i<num_matches; ++i, prev_cu = cu)
     {
         cu = info->GetCompileUnitAtIndex(die_info_array[i].cu_idx);
@@ -2770,7 +2774,7 @@
                     {
                         // We have a forward declaration
                         std::vector<NameToDIE::Info> die_info_array;
-                        const size_t num_matches = m_types_index.Find (type_name_const_str, die_info_array);
+                        const size_t num_matches = m_type_index.Find (type_name_const_str, die_info_array);
                         DWARFCompileUnit* type_cu = NULL;
                         DWARFCompileUnit* curr_cu = dwarf_cu;
                         DWARFDebugInfo *info = DebugInfo();

Modified: lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.h?rev=116558&r1=116557&r2=116558&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.h (original)
+++ lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.h Thu Oct 14 21:03:22 2010
@@ -313,8 +313,9 @@
     NameToDIE                           m_function_method_index;    // All inlined functions
     NameToDIE                           m_function_selector_index;  // All method names for functions of classes
     NameToDIE                           m_objc_class_selectors_index; // Given a class name, find all selectors for the class
-    NameToDIE                           m_global_index;             // Global and static variables
-    NameToDIE                           m_types_index;              // All type DIE offsets
+    NameToDIE                           m_global_index;                 // Global and static variables
+    NameToDIE                           m_type_index;                  // All type DIE offsets
+    NameToDIE                           m_namespace_index;              // All type DIE offsets
     bool m_indexed;
 
     std::auto_ptr<DWARFDebugRanges>     m_ranges;





More information about the lldb-commits mailing list