[Lldb-commits] [PATCH] D133461: [LLDB][NativePDB] Set block address range.

Pavel Labath via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Fri Sep 9 05:46:22 PDT 2022


labath added inline comments.


================
Comment at: lldb/source/Plugins/SymbolFile/NativePDB/SymbolFileNativePDB.cpp:372
+        func->GetAddressRange().GetBaseAddress().GetFileAddress();
+    Block::Range range = Block::Range(block_base - func_base, block.CodeSize);
+    if (block_base >= func_base)
----------------
better move this inside the if block, so one does not have to think about what will happen when the address wraps around.


================
Comment at: lldb/test/Shell/SymbolFile/NativePDB/blocks.cpp:17
+
+// CHECK:      Function: id = {{.*}}, name = "main", range = [0x0000000140001000-0x000000014000104b)
+// CHECK-NEXT: FuncType: id = {{.*}}, byte-size = 0, compiler_type = "int (void)"
----------------
I fear this test is going to be extremely fragile (susceptible to changes in codegen AND debug info generation). I'd probably write it in asm (you could even test the error msg then).


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D133461/new/

https://reviews.llvm.org/D133461



More information about the lldb-commits mailing list