[PATCH] D46878: Add DW_AT_linkage_name for DW_TAG_labels

John Reagan via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sat Oct 20 12:43:17 PDT 2018


JohnReagan 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);
----------------
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?




https://reviews.llvm.org/D46878





More information about the llvm-commits mailing list