[Lldb-commits] [lldb] r160392 - /lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.cpp

Greg Clayton gclayton at apple.com
Tue Jul 17 13:18:12 PDT 2012


Author: gclayton
Date: Tue Jul 17 15:18:12 2012
New Revision: 160392

URL: http://llvm.org/viewvc/llvm-project?rev=160392&view=rev
Log:
<rdar://problem/11852285>

Remove assertions and turn what used the be the assertion into a logged error with instructions on what to attach to a radar so we can track down why this is happening.


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

Modified: lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.cpp?rev=160392&r1=160391&r2=160392&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.cpp (original)
+++ lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.cpp Tue Jul 17 15:18:12 2012
@@ -143,14 +143,20 @@
                     m_compile_unit_infos[i].so_symbol = symtab->SymbolAtIndex(oso_indexes[i] - 2);
                 m_compile_unit_infos[i].oso_symbol = symtab->SymbolAtIndex(oso_indexes[i]);
                 uint32_t sibling_idx = m_compile_unit_infos[i].so_symbol->GetSiblingIndex();
-                assert (sibling_idx != 0);
-                assert (sibling_idx > i + 1);
-                m_compile_unit_infos[i].last_symbol = symtab->SymbolAtIndex (sibling_idx - 1);
-                m_compile_unit_infos[i].first_symbol_index = symtab->GetIndexForSymbol(m_compile_unit_infos[i].so_symbol);
-                m_compile_unit_infos[i].last_symbol_index = symtab->GetIndexForSymbol(m_compile_unit_infos[i].last_symbol);
-                
-                if (log)
-                    log->Printf("Initialized OSO 0x%8.8x: file=%s", i, m_compile_unit_infos[i].oso_symbol->GetName().GetCString());
+                // The sibling index can't be less that or equal to the current index "i"
+                if (sibling_idx <= i)
+                {
+                    m_obj_file->GetModule()->ReportError ("N_SO in symbol with UID %u has invalid sibling in debug map, please file a bug and attach the binary listed in this error", m_compile_unit_infos[i].so_symbol->GetID());
+                }
+                else
+                {
+                    m_compile_unit_infos[i].last_symbol = symtab->SymbolAtIndex (sibling_idx - 1);
+                    m_compile_unit_infos[i].first_symbol_index = symtab->GetIndexForSymbol(m_compile_unit_infos[i].so_symbol);
+                    m_compile_unit_infos[i].last_symbol_index = symtab->GetIndexForSymbol(m_compile_unit_infos[i].last_symbol);
+                    
+                    if (log)
+                        log->Printf("Initialized OSO 0x%8.8x: file=%s", i, m_compile_unit_infos[i].oso_symbol->GetName().GetCString());
+                }
             }
         }
     }





More information about the lldb-commits mailing list