[PATCH] D46878: Add DW_AT_linkage_name for DW_TAG_labels

Adrian Prantl via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Oct 22 08:56:44 PDT 2018


aprantl added inline comments.


================
Comment at: lib/MC/MCDwarf.cpp:562
   EmitAbbrev(MCOS, dwarf::DW_AT_name, dwarf::DW_FORM_string);
+  EmitAbbrev(MCOS, dwarf::DW_AT_linkage_name, dwarf::DW_FORM_string);
   EmitAbbrev(MCOS, dwarf::DW_AT_decl_file, dwarf::DW_FORM_data4);
----------------
JohnReagan wrote:
> Uh, DW_AT_linkage_name isn't intended to be used with DW_TAG_labels.  It is really meant to provide the mangled names with entries, etc.  From DWARF4 spec
> 
> "Debugging information entries to which DW_AT_linkage_name may apply include: DW_TAG_common_block, DW_TAG_constant, DW_TAG_entry_point, DW_TAG_subprogram and DW_TAG_variable."
> 
> DWARF5 dropped that wording, but you can still infer that list from Appendix A, etc.
> 
> I can see that we already emit DW_AT_prototyped for DW_TAG_labels (also extra to the standard).
> 
> There are other debuggers who consume this stuff.  We're about to start work on the OpenVMS debugger to bring it up past DWARF3 and I would have assumed (incorrectly) that nobody would emit these DW_AT_ attributes for labels.
> 
> Is there a document somewhere that tracks these extra-standard extensions?
> 
> 
> DWARF5 dropped that wording, but you can still infer that list from Appendix A, etc.
I wonder if the information in Appendix A (which is non-normative) isn't an oversight. Might be worth bringing this up on the dwarf-discuss mailing list.

> Is there a document somewhere that tracks these extra-standard extensions?
Not that I'm aware of. Generally LLVM tends to be fairly permissive about emitting extra dwarf attributes based on that consumers can always ignore extra attributes they don't understand.


https://reviews.llvm.org/D46878





More information about the llvm-commits mailing list