[Lldb-commits] [lldb] r355943 - Correcting some comments in PdbIndex.cpp [NFC]

Adrian McCarthy via lldb-commits lldb-commits at lists.llvm.org
Tue Mar 12 10:40:51 PDT 2019


Author: amccarth
Date: Tue Mar 12 10:40:51 2019
New Revision: 355943

URL: http://llvm.org/viewvc/llvm-project?rev=355943&view=rev
Log:
Correcting some comments in PdbIndex.cpp [NFC]

ICF can cause multiple symbols to start at the same virtual address.
I plan to handle this shortly, but I wanted to correct the comment for
now.

Deleted an obsolete comment about adjusting the offset for the magic
number at the beginning of the debug info stream.  This adjustment is
handled at a lower level now.

Modified:
    lldb/trunk/source/Plugins/SymbolFile/NativePDB/PdbIndex.cpp

Modified: lldb/trunk/source/Plugins/SymbolFile/NativePDB/PdbIndex.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/SymbolFile/NativePDB/PdbIndex.cpp?rev=355943&r1=355942&r2=355943&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/SymbolFile/NativePDB/PdbIndex.cpp (original)
+++ lldb/trunk/source/Plugins/SymbolFile/NativePDB/PdbIndex.cpp Tue Mar 12 10:40:51 2019
@@ -132,9 +132,8 @@ void PdbIndex::BuildAddrToSymbolMap(Comp
 
     PdbCompilandSymId cu_sym_id(modi, iter.offset());
 
-    // If the debug info is incorrect, we could have multiple symbols with the
-    // same address.  So use try_emplace instead of insert, and the first one
-    // will win.
+    // It's rare, but we could have multiple symbols with the same address
+    // because of identical comdat folding.  Right now, the first one will win.
     cci.m_symbols_by_va.insert(std::make_pair(va, PdbSymUid(cu_sym_id)));
   }
 }
@@ -186,8 +185,6 @@ std::vector<SymbolAndUid> PdbIndex::Find
 }
 
 CVSymbol PdbIndex::ReadSymbolRecord(PdbCompilandSymId cu_sym) const {
-  // We need to subtract 4 here to adjust for the codeview debug magic
-  // at the beginning of the debug info stream.
   const CompilandIndexItem *cci = compilands().GetCompiland(cu_sym.modi);
   auto iter = cci->m_debug_stream.getSymbolArray().at(cu_sym.offset);
   lldbassert(iter != cci->m_debug_stream.getSymbolArray().end());




More information about the lldb-commits mailing list