[llvm] [LLVM][DebugInfo] Refactor some code for easier sharing. (PR #82153)

David Blaikie via llvm-commits llvm-commits at lists.llvm.org
Mon Mar 18 15:51:18 PDT 2024


================
@@ -552,32 +552,50 @@ DWARFDebugNames::NameIndex::extractAbbrev(uint64_t *Offset) {
   return Abbrev(Code, dwarf::Tag(Tag), AbbrevOffset, std::move(*AttrEncOr));
 }
 
+void llvm::findDebugNamesOffsets(
+    DWARFDebugNames::DWARFDebugNamesOffsets &Offsets, uint64_t HdrSize,
----------------
dwblaikie wrote:

`HdrSize` isn't an accurate name for this parameter, I think @felipepiovezan mentioned `EndOfHeaderOffset` as a name in https://github.com/llvm/llvm-project/pull/82153#discussion_r1495104676 which seems accurate.

(the issue here is that while `HdrSize` and `EndOfHeaderOffset` would be identical for the first debug names table in a `.debug_names` section - they aren't identical for the second/other subsequent contributions - `EndOfHeaderOffset` is the offset in the .debug_names section after the header we care about here, which might be the Nth header, not necessarily the first)

https://github.com/llvm/llvm-project/pull/82153


More information about the llvm-commits mailing list