[Lldb-commits] [lldb] r117948 - /lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp

Greg Clayton gclayton at apple.com
Mon Nov 1 13:32:12 PDT 2010


Author: gclayton
Date: Mon Nov  1 15:32:12 2010
New Revision: 117948

URL: http://llvm.org/viewvc/llvm-project?rev=117948&view=rev
Log:
Fixed globals not showing up for any but the first compile unit due to a 
mismatch: I was using the compile unit user ID (the compile unit offset in
the DWARF) as the compile unit index.


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

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=117948&r1=117947&r2=117948&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp (original)
+++ lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp Mon Nov  1 15:32:12 2010
@@ -3447,7 +3447,12 @@
 {
     if (sc.comp_unit != NULL)
     {
-        DWARFCompileUnit* dwarf_cu = GetDWARFCompileUnitForUID(sc.comp_unit->GetID());
+        DWARFDebugInfo* info = DebugInfo();
+        if (info == NULL)
+            return 0;
+        
+        uint32_t cu_idx = UINT32_MAX;
+        DWARFCompileUnit* dwarf_cu = info->GetCompileUnit(sc.comp_unit->GetID(), &cu_idx).get();
 
         if (dwarf_cu == NULL)
             return 0;
@@ -3476,9 +3481,8 @@
                 if (!m_indexed)
                     Index ();
 
-
                 std::vector<NameToDIE::Info> global_die_info_array;
-                const size_t num_globals = m_global_index.FindAllEntriesForCompileUnitWithIndex (sc.comp_unit->GetID(), global_die_info_array);
+                const size_t num_globals = m_global_index.FindAllEntriesForCompileUnitWithIndex (cu_idx, global_die_info_array);
                 for (size_t idx=0; idx<num_globals; ++idx)
                 {
                     VariableSP var_sp (ParseVariableDIE(sc, dwarf_cu, dwarf_cu->GetDIEAtIndexUnchecked(global_die_info_array[idx].die_idx), LLDB_INVALID_ADDRESS));





More information about the lldb-commits mailing list