From afd639071bb32baae4ca390b3f0f5ab700d83222 Mon Sep 17 00:00:00 2001 From: Zequan Wu Date: Wed, 27 Apr 2022 10:46:51 -0700 Subject: [PATCH] [LLDB][NativePDB] Minor fix ParseInlinesite. - Don't reset cur_line_offset to llvm::None when we don't have next_line_offset, because we may need to reuse it in new range after a code end. - Don't use CombineConsecutiveEntriesWithEqualData for inline_site_sp->ranges, because that will combine consecutive entries with same data in the vector regardless of the entry's range. Originally, I thought that it only combine consecutive entries if adjacent entries' ranges are adjoining or intersecting with each other. --- .../Plugins/SymbolFile/NativePDB/SymbolFileNativePDB.cpp | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/lldb/source/Plugins/SymbolFile/NativePDB/SymbolFileNativePDB.cpp b/lldb/source/Plugins/SymbolFile/NativePDB/SymbolFileNativePDB.cpp index fcbf667..22d8977 100644 --- a/lldb/source/Plugins/SymbolFile/NativePDB/SymbolFileNativePDB.cpp +++ b/lldb/source/Plugins/SymbolFile/NativePDB/SymbolFileNativePDB.cpp @@ -1311,8 +1311,8 @@ void SymbolFileNativePDB::ParseInlineSite(PdbCompilandSymId id, int32_t line_offset = 0; llvm::Optional code_offset_base; llvm::Optional code_offset_end; - llvm::Optional cur_line_offset; - llvm::Optional next_line_offset; + llvm::Optional cur_line_offset; + llvm::Optional next_line_offset; llvm::Optional next_file_offset; bool is_terminal_entry = false; @@ -1384,9 +1384,12 @@ void SymbolFileNativePDB::ParseInlineSite(PdbCompilandSymId id, // Set base, end, file offset and line offset for next range. if (next_file_offset) file_offset = *next_file_offset; - cur_line_offset = next_line_offset ? next_line_offset : llvm::None; + if (next_line_offset) { + cur_line_offset = next_line_offset; + next_line_offset = llvm::None; + } code_offset_base = is_terminal_entry ? llvm::None : code_offset_end; - code_offset_end = next_line_offset = next_file_offset = llvm::None; + code_offset_end = next_file_offset = llvm::None; } if (code_offset_base && cur_line_offset) { if (is_terminal_entry) { @@ -1410,7 +1413,6 @@ void SymbolFileNativePDB::ParseInlineSite(PdbCompilandSymId id, } inline_site_sp->ranges.Sort(); - inline_site_sp->ranges.CombineConsecutiveEntriesWithEqualData(); // Get the inlined function callsite info. std::unique_ptr callsite_up; -- 2.7.4