[llvm] [DebugInfo][DWARF] Emit Per-Function Line Table Offsets and End Sequences (PR #110192)
David Blaikie via llvm-commits
llvm-commits at lists.llvm.org
Mon Oct 21 16:03:47 PDT 2024
================
@@ -123,6 +123,9 @@ class MCDwarfLoc {
friend class MCContext;
friend class MCDwarfLineEntry;
+ // DwarfDebug::endFunctionImpl needs to construct MCDwarfLoc(IsEndOfFunction)
+ friend class DwarfDebug;
----------------
dwblaikie wrote:
If DwarfDebug needs some functionality in MCDwarf, it should probably be exposed to any MCDwarf client rather than uniquely to DwarfDebug.
But I don't know that DW_LNE_end_sequence placement should be chosen by DwarfDebug - it should go at the end of any chunk of .text that can be sliced-and-diced by the linker. (which means it should probably be at the end of every function on MachO when using subsections-via-symbols (but I guess it isn't currently, because the DWARF only gets rewritten by dsymutil which is DWARF-aware), or on ELF with `-ffunction-sections`)
In general I'd expect DwarfDebug to not actually request where line table sequences start and end - they're a function of the object format about where content can be treated as contiguous or not.
Except for this patch, which needs a label that starts a sequence even if it isn't in what would be an isolated chunk (though I have my doubts about that - if the function isn't at the start of an isolated chunk of .text, does it need one of these labels? Could it use the label of the start of the isolated chunk it's part of? Could it share that location somehow with all functions in that chunk?)
https://github.com/llvm/llvm-project/pull/110192
More information about the llvm-commits
mailing list