[Lldb-commits] [lldb] 827ff1e - [LLDB][NativePDB] Fix incorrect file index of inlinees introduced by f00cd23caed5f920495bcae2055f4c478d8383d6

Zequan Wu via lldb-commits lldb-commits at lists.llvm.org
Mon Apr 25 16:07:14 PDT 2022


Author: Zequan Wu
Date: 2022-04-25T16:07:04-07:00
New Revision: 827ff1e576f71fd3b81c4b012bf852eb6f46f808

URL: https://github.com/llvm/llvm-project/commit/827ff1e576f71fd3b81c4b012bf852eb6f46f808
DIFF: https://github.com/llvm/llvm-project/commit/827ff1e576f71fd3b81c4b012bf852eb6f46f808.diff

LOG: [LLDB][NativePDB] Fix incorrect file index of inlinees introduced by f00cd23caed5f920495bcae2055f4c478d8383d6

Added: 
    

Modified: 
    lldb/source/Plugins/SymbolFile/NativePDB/SymbolFileNativePDB.cpp
    lldb/source/Plugins/SymbolFile/NativePDB/SymbolFileNativePDB.h

Removed: 
    


################################################################################
diff  --git a/lldb/source/Plugins/SymbolFile/NativePDB/SymbolFileNativePDB.cpp b/lldb/source/Plugins/SymbolFile/NativePDB/SymbolFileNativePDB.cpp
index 00d4422bc979e..57b3cca47daa8 100644
--- a/lldb/source/Plugins/SymbolFile/NativePDB/SymbolFileNativePDB.cpp
+++ b/lldb/source/Plugins/SymbolFile/NativePDB/SymbolFileNativePDB.cpp
@@ -1225,9 +1225,6 @@ bool SymbolFileNativePDB::ParseDebugMacros(CompileUnit &comp_unit) {
 llvm::Expected<uint32_t>
 SymbolFileNativePDB::GetFileIndex(const CompilandIndexItem &cii,
                                   uint32_t file_id) {
-  auto index_iter = m_file_indexes.find(file_id);
-  if (index_iter != m_file_indexes.end())
-    return index_iter->getSecond();
   const auto &checksums = cii.m_strings.checksums().getArray();
   const auto &strings = cii.m_strings.strings();
   // Indices in this structure are actually offsets of records in the
@@ -1244,9 +1241,9 @@ SymbolFileNativePDB::GetFileIndex(const CompilandIndexItem &cii,
 
   // LLDB wants the index of the file in the list of support files.
   auto fn_iter = llvm::find(cii.m_file_list, *efn);
-  lldbassert(fn_iter != cii.m_file_list.end());
-  m_file_indexes[file_id] = std::distance(cii.m_file_list.begin(), fn_iter);
-  return m_file_indexes[file_id];
+  if (fn_iter != cii.m_file_list.end())
+    return std::distance(cii.m_file_list.begin(), fn_iter);
+  return llvm::make_error<RawError>(raw_error_code::no_entry);
 }
 
 bool SymbolFileNativePDB::ParseSupportFiles(CompileUnit &comp_unit,

diff  --git a/lldb/source/Plugins/SymbolFile/NativePDB/SymbolFileNativePDB.h b/lldb/source/Plugins/SymbolFile/NativePDB/SymbolFileNativePDB.h
index f1b6e34ca346b..d626daf4e95d3 100644
--- a/lldb/source/Plugins/SymbolFile/NativePDB/SymbolFileNativePDB.h
+++ b/lldb/source/Plugins/SymbolFile/NativePDB/SymbolFileNativePDB.h
@@ -272,8 +272,6 @@ class SymbolFileNativePDB : public SymbolFile {
   llvm::DenseMap<lldb::user_id_t, lldb::CompUnitSP> m_compilands;
   llvm::DenseMap<lldb::user_id_t, lldb::TypeSP> m_types;
   llvm::DenseMap<lldb::user_id_t, std::shared_ptr<InlineSite>> m_inline_sites;
-  // A map from file id in records to file index in support files.
-  llvm::DenseMap<uint32_t, uint32_t> m_file_indexes;
 };
 
 } // namespace npdb


        


More information about the lldb-commits mailing list