[Lldb-commits] [lldb] afd6390 - [LLDB][NativePDB] Minor fix ParseInlinesite.

Zequan Wu via lldb-commits lldb-commits at lists.llvm.org
Wed Apr 27 10:56:12 PDT 2022


Author: Zequan Wu
Date: 2022-04-27T10:56:03-07:00
New Revision: afd639071bb32baae4ca390b3f0f5ab700d83222

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

LOG: [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.

Added: 
    

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

Removed: 
    


################################################################################
diff  --git a/lldb/source/Plugins/SymbolFile/NativePDB/SymbolFileNativePDB.cpp b/lldb/source/Plugins/SymbolFile/NativePDB/SymbolFileNativePDB.cpp
index fcbf667798644..22d8977e117b0 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<uint32_t> code_offset_base;
   llvm::Optional<uint32_t> code_offset_end;
-  llvm::Optional<uint32_t> cur_line_offset;
-  llvm::Optional<uint32_t> next_line_offset;
+  llvm::Optional<int32_t> cur_line_offset;
+  llvm::Optional<int32_t> next_line_offset;
   llvm::Optional<uint32_t> 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<Declaration> callsite_up;


        


More information about the lldb-commits mailing list