On Mon, Mar 22, 2021 at 1:39 PM Mark Harmstone <m...@harmstone.com> wrote: > > Thanks Richard. > > > How do CV and DWARF debug differ and is emitting CV debug from a DWARF > > representation possible (I suppose there might even exist offline > > conversion tools?) > > I don't know enough about DWARF internals to answer that, but I'd be surprised > if the answer is "no". > > Do you mean that the DWARF code would collect the data, and my code would > process it and output the .debug$S and .debug$T sections? So from the point of > view of the linker, everything will be the same?
Yes. The rough idea is to hook into either dwarf2out_finish or dwarf2out_early_finish (or both), and process the DWARF DIE tree starting from comp_unit_die () to produce the .debug$S and .debug$T sections. It sounds like .debug$T can be emitted from dwarf2out_early_finish while .debug$S needs dwarf2out_finish since the section might refer to actual data/code objects? > > I'll see to add some fat commentary above the debug hooks structure (not > > sure if that will help in practice). > > This would definitely help. I'd no idea of this before now, and I would have > spotted a DEPRECATED above the struct definition. Sorry about this, giving a heads-up about the ongoing project would also have got you this information. I've posted a patch to add such notice now. Richard. > Mark >