[llvm-dev] Potential DWARF debug info bug: DW_TAG_label DIE has a DW_AT_prototyped attribute

David Blaikie via llvm-dev llvm-dev at lists.llvm.org
Sun Jan 20 14:04:00 PST 2019


Looks like it might've been an artifact of assembly label support initially
being implemented as DW_TAG_subprograms (in r146262) & then being changed
to use DW_TAG_label (in r147860). Yeah, don't much see the benefit in it
off-hand at least.

On Fri, Jan 18, 2019 at 2:35 PM via llvm-dev <llvm-dev at lists.llvm.org>
wrote:

>
>
> > -----Original Message-----
> > From: llvm-dev [mailto:llvm-dev-bounces at lists.llvm.org] On Behalf Of
> > Adrian Prantl via llvm-dev
> > Sent: Friday, January 18, 2019 5:20 PM
> > To: Snider, Todd
> > Cc: llvm-dev at lists.llvm.org
> > Subject: Re: [llvm-dev] Potential DWARF debug info bug: DW_TAG_label DIE
> > has a DW_AT_prototyped attribute
> >
> >
> >
> > > On Jan 18, 2019, at 1:06 PM, Snider, Todd via llvm-dev <llvm-
> > dev at lists.llvm.org> wrote:
> > >
> > >
> > > In llvm/lib/MC/MCDwarf.cpp’s EmitGenDwarfAbbrev(), the DWARF
> > abbreviation declaration for a DW_TAG_label includes a DW_AT_prototyped
> > attribute, but the DWARF 4 specification indicates that the
> > DW_AT_prototyped attribute is not a valid attribute for the DW_TAG_label
> > debug information entry (DIE). In this case, EmitGenDwarfAbbrev() is
> > clearly in violation of the DWARF 4 specification.
>
> DWARF is a "permissive" standard which means it's not illegal to do this,
> so it might be instructive to look at the change history to see if the
> commit(s) that introduced it have any explanation.
>
> Offhand, though, I agree it appears to be a complete waste of space and
> worth taking out.
> --paulr
>
> > >
> > > However, I notice that one of the MachO lit tests is expecting the
> > DW_TAG_label DIE to contain a DW_AT_prototyped attribute whose value is
> > false (llvm/test/MC/MachO/gen-dwarf.s).
> > >
> > > Does the DW_AT_prototyped attribute sever any purpose or provide any
> > value in the context of a DW_TAG_label DIE?
> > >
> > > If not, I propose to remove the call to EmitAbbrev() on behalf of the
> > DW_AT_prototyped attribute for a DW_TAG_label in EmitGenDwarfAbbrev().
> >
> > I don't think that any Mach-O DWARF consumer depends on the presence of
> > DW_TAG_prototyped inside of a DW_TAG_label. The only occurrence of
> > DW_TAG_prototyped inside of LLDB for example is in a switch statement of
> > attributes that are ignored...
> >
> > Feel free to add me (and the "debug-info" group) as a reviewer for the
> > patch in phabricator.
> >
> > thanks,
> > adrian
> > _______________________________________________
> > LLVM Developers mailing list
> > llvm-dev at lists.llvm.org
> > http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev
> _______________________________________________
> LLVM Developers mailing list
> llvm-dev at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20190120/49f4058b/attachment.html>


More information about the llvm-dev mailing list