Handling DWARF "units"

Currently, LLVM's DWARF parser keeps Compile Units and Type Units
on separate lists, basically organizing them by ELF section. This
works okay for DWARF v4, because Type Units are in .debug_types
(possibly in individual COMDATs) and everything else is in the
.debug_info section (without COMDATs). The two lists conveniently
can be templated/typed with DWARFTypeUnit and DWARFCompileUnit.

In DWARF v5, Type Units (possibly with COMDATs) are in .debug_info
and there is no .debug_types section anymore. This makes the
current organization of Units in the LLVM DWARF parser really kind
of inconvenient. Although the parser does still need to handle
DWARF v4, it doesn't have to manage the parsed Units the same way
as it does now. I hope.

(Probably worth mentioning that you have to read at least the
header of a Unit out of .debug_info before you know what kind it is.)

Also I understand Jan Kratochvil is working on making Partial Units
a thing in the LLDB DWARF parser, as part of his DWZ work, and then
Greg Clayton has been taking a run at introducing Type Units to the
LLDB parser. With all the independent refactorings of the two
parsers, we're tripping over each other and maybe not getting any
closer to the dream of having a Grand Unified Parser used by both
LLDB and LLVM.

I don't have a design to propose. The main reason I'm sending up
this particular flare right now is that I'm about to head off to
EuroLLVM and if other interested parties will be there, maybe we
can make some headway on this. There is the DebugInfo BoF, and
"I'm here all week" if people want to scrounge a Round Table or
a corner of the Hacker's Lab.

Comments/proposals welcome, or look me up at EuroLLVM.
Thanks,
--paulr

Also I understand Jan Kratochvil is working on making Partial Units
a thing in the LLDB DWARF parser, as part of his DWZ work,

Yes, with some integration discussions in the threads:
  [Lldb-commits] [PATCH] D45170: Cleanup DWARFCompileUnit and DWARFUnit in preparation for adding DWARFTypeUnit
  https://lists.llvm.org/pipermail/lldb-commits/Week-of-Mon-20180409/040193.html
  [Lldb-commits] [PATCH] D32167: Add support for type units (.debug_types) to LLDB in a way that is compatible with DWARF 5
  https://lists.llvm.org/pipermail/lldb-commits/Week-of-Mon-20180409/040199.html

The main reason I'm sending up this particular flare right now is that I'm
about to head off to EuroLLVM and if other interested parties will be there,

I am sorry I won't be at this EuroLLVM.

Jan