Issue 241209.1: Policy for DWARF6 language codes in DWARF5 producers
| Author: | Mark Wielaard |
|---|---|
| Champion: | Mark Wielaard |
| Date submitted: | 2024-12-09 |
| Date revised: | |
| Date closed: | 2025-01-06 |
| Type: | Enhancement |
| Status: | Accepted |
| DWARF version: | 6 |
Background
Issue 210204.1 added a registration page
https://dwarfstd.org/languages.html for new DW_AT_language codes
(DW_LANG_) to supplement the DWARF5 list.
Issue 210419.1 (for DWARF6) split DW_AT_language into
DW_AT_language_name codes (DW_LNAME) and DW_AT_language_version codes
(version schemes). These are listed at
https://dwarfstd.org/languages-v6.html with the following note:
"The information on this page is part of the Draft of DWARF Version 6
and is subject to change."
Some producers are reluctant to add the new language codes for DWARF5
because consumers need to be updated to recognize the language
(family). e.g. when using DW_LANG_C_plus_plus_20, a consumer might no
longer recognize the language being debugged as C++. So a producer
will only add new DWARF5 language codes when all consumers have been
updated and seen a stable release.
Usage of the proposed DWARF6 split DW_AT_language_name and
DW_AT_language_version might help, once all consumers are updated to
recognize these. Or when using "old" DWARF5 DW_AT_language codes
combined with DW_AT_language_name/version indicating newer language
versions.
There is a proposed DWARF Extension registry Issue 231110.3.
But this is for user extensions. The DWARF6 DW_AT_language_name/version use
reserved numbers (and the note on the languages-v6 says they are not
currently stable).
Proposed solution
Replace the Note on https://dwarfstd.org/languages-v6.html to say:
Note: The information on this page is part of the Draft of DWARF Version 6. But as an exception, the
DW_AT_language_name(0x90) andDW_AT_language_version(0x91) attributes, plus theDW_LNAMEconstants listed on this page are fixed (as are the default lower bounds and version schemes). They may be used in DWARF5 producers when emitting a CU DIE. Such producers must still also emit aDW_AT_languageattribute as listed on https://dwarfstd.org/languages.html.
2025-01-06: Accepted, but the listed values are not consistent with
latest DWARF-6 draft. DW_AT_language_name is 0x90 and
DW_AT_language_version is 0x91. Will add comment in the TeX source
of the spec that these numbers are promised and cannot be changed.