Skip to content

Commit 827ff1e

Browse files
committed
[LLDB][NativePDB] Fix incorrect file index of inlinees introduced by f00cd23
1 parent 1f31795 commit 827ff1e

File tree

2 files changed

+3
-8
lines changed

2 files changed

+3
-8
lines changed

lldb/source/Plugins/SymbolFile/NativePDB/SymbolFileNativePDB.cpp

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1225,9 +1225,6 @@ bool SymbolFileNativePDB::ParseDebugMacros(CompileUnit &comp_unit) {
12251225
llvm::Expected<uint32_t>
12261226
SymbolFileNativePDB::GetFileIndex(const CompilandIndexItem &cii,
12271227
uint32_t file_id) {
1228-
auto index_iter = m_file_indexes.find(file_id);
1229-
if (index_iter != m_file_indexes.end())
1230-
return index_iter->getSecond();
12311228
const auto &checksums = cii.m_strings.checksums().getArray();
12321229
const auto &strings = cii.m_strings.strings();
12331230
// Indices in this structure are actually offsets of records in the
@@ -1244,9 +1241,9 @@ SymbolFileNativePDB::GetFileIndex(const CompilandIndexItem &cii,
12441241

12451242
// LLDB wants the index of the file in the list of support files.
12461243
auto fn_iter = llvm::find(cii.m_file_list, *efn);
1247-
lldbassert(fn_iter != cii.m_file_list.end());
1248-
m_file_indexes[file_id] = std::distance(cii.m_file_list.begin(), fn_iter);
1249-
return m_file_indexes[file_id];
1244+
if (fn_iter != cii.m_file_list.end())
1245+
return std::distance(cii.m_file_list.begin(), fn_iter);
1246+
return llvm::make_error<RawError>(raw_error_code::no_entry);
12501247
}
12511248

12521249
bool SymbolFileNativePDB::ParseSupportFiles(CompileUnit &comp_unit,

lldb/source/Plugins/SymbolFile/NativePDB/SymbolFileNativePDB.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -272,8 +272,6 @@ class SymbolFileNativePDB : public SymbolFile {
272272
llvm::DenseMap<lldb::user_id_t, lldb::CompUnitSP> m_compilands;
273273
llvm::DenseMap<lldb::user_id_t, lldb::TypeSP> m_types;
274274
llvm::DenseMap<lldb::user_id_t, std::shared_ptr<InlineSite>> m_inline_sites;
275-
// A map from file id in records to file index in support files.
276-
llvm::DenseMap<uint32_t, uint32_t> m_file_indexes;
277275
};
278276

279277
} // namespace npdb

0 commit comments

Comments
 (0)