[PATCH] D137882: [DWARFLibrary] Add support to re-construct cu-index

David Blaikie via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Mar 17 15:20:54 PDT 2023


dblaikie added inline comments.


================
Comment at: llvm/lib/DebugInfo/DWARF/DWARFContext.cpp:868-871
+  // If we are parsing TU-index and for .debug_types section we don't need
+  // to do anything.
+  if (isParseSuccessful && TUIndex->getVersion() != 2)
+    fixupIndex(*DObj, *this, *TUIndex.get());
----------------
ayermolo wrote:
> dblaikie wrote:
> > Any idea what this comment/code were about checking the type index version? I don't see any reason this fixup wouldn't be relevant to DWARFv4 type unit indexes - though the fixup code would have to take the section to parse as a parameter, since it's currently hardcoded to the debug_info sections, not the debug_types sections.
> I don't quite remember why. I think it was to narrow the scope.
> Also don't we also need to call forEachTypesDWOSections if we want to handle .debug_types section?
> Why do you see overflows in that section also?
We aren't having an issue here - since it's only DWARFv4+type units, and we're using DWARFv5 these days.

I've been looking at adding DWARFv5 overflow recovery (which can be more robust than DWARFv4, since DWARFv5 can get the DWOID/type signature without needing the abbrev section) and just looking more closely at this code/seeing these quirks & wanted to understand it better.

But, yeah, maybe just not worth supporting *shrug* no worries, thanks!


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D137882



More information about the llvm-commits mailing list