gcc/include
Jakub Jelinek ec99905f7b dwarf2out: Emit DWARF 6 DW_AT_language_{name,version}
DWARF has voted in recently https://dwarfstd.org/issues/241209.1.html ,
which is basically just a guarantee that the DWARF 6 draft
DW_AT_language_{name,version} attribute codes and content of
https://dwarfstd.org/languages-v6.html can be used as an extension
in DWARF 5 and won't be changed.

So, this patch is an alternative to the
https://gcc.gnu.org/pipermail/gcc-patches/2024-November/669671.html
patch, which had the major problem that it required changing all the
DWARF consumers to be able to debug C17 or later or C++17 or later
sources.
This patch uses still DWARF 5 DW_LANG_C11 or DW_LANG_C_plus_plus_14,
the latest code in DWARF 5 proper, so all DWARF 5 capable consumers
should be able to deal with that, but additionally emits the
DWARF 6 attributes so that newer DWARF consumers can see it isn't
just C++14 but say C++23 or C11 but C23.  Consumers which don't know
those DWARF 6 attributes would just ignore them.  This is like any other
-gno-strict-dwarf extension, except that normally we emit say DWARF 5
codes where possible only after DWARF 5 is released, while in this case
there is a guarantee it can be used before DWARF 6 is released.

2025-01-08  Jakub Jelinek  <jakub@redhat.com>

include/
	* dwarf2.h (enum dwarf_source_language): Fix comment pasto.
	(enum dwarf_source_language_name): New type.
	* dwarf2.def (DW_AT_language_name, DW_AT_language_version): New
	DWARF 6 codes.
gcc/
	* dwarf2out.cc (break_out_comdat_types): Copy over
	DW_AT_language_{name,version} if present.
	(output_skeleton_debug_sections): Remove also
	DW_AT_language_{name,version}.
	(gen_compile_unit_die): For C17, C23, C2Y, C++17, C++20, C++23
	and C++26 emit for -gdwarf-5 -gno-strict-dwarf also
	DW_AT_language_{name,version} attributes.
gcc/testsuite/
	* g++.dg/debug/dwarf2/lang-cpp17.C: Add -gno-strict-dwarf to
	dg-options.  Check also for DW_AT_language_{name,version} values.
	* g++.dg/debug/dwarf2/lang-cpp20.C: Likewise.
	* g++.dg/debug/dwarf2/lang-cpp23.C: New test.
2025-01-08 10:57:50 +01:00
..
cuda Update copyright years. 2025-01-02 11:59:57 +01:00
gdb Update copyright years. 2025-01-02 11:59:57 +01:00
ansidecl.h Update copyright years. 2025-01-02 11:59:57 +01:00
btf.h Update copyright years. 2025-01-02 11:59:57 +01:00
ChangeLog Daily bump. 2024-12-30 00:17:12 +00:00
ChangeLog-9103
ChangeLog.jit
collectorAPI.h Update copyright years. 2025-01-02 11:59:57 +01:00
COPYING
COPYING3
ctf.h Update copyright years. 2025-01-02 11:59:57 +01:00
demangle.h Update copyright years. 2025-01-02 11:59:57 +01:00
dwarf2.def dwarf2out: Emit DWARF 6 DW_AT_language_{name,version} 2025-01-08 10:57:50 +01:00
dwarf2.h dwarf2out: Emit DWARF 6 DW_AT_language_{name,version} 2025-01-08 10:57:50 +01:00
dyn-string.h Update copyright years. 2025-01-02 11:59:57 +01:00
environ.h Update copyright years. 2025-01-02 11:59:57 +01:00
fibheap.h Update copyright years. 2025-01-02 11:59:57 +01:00
filenames.h Update copyright years. 2025-01-02 11:59:57 +01:00
floatformat.h Update copyright years. 2025-01-02 11:59:57 +01:00
fnmatch.h Update copyright years. 2025-01-02 11:59:57 +01:00
gcc-c-fe.def Update copyright years. 2025-01-02 11:59:57 +01:00
gcc-c-interface.h Update copyright years. 2025-01-02 11:59:57 +01:00
gcc-cp-fe.def Update copyright years. 2025-01-02 11:59:57 +01:00
gcc-cp-interface.h Update copyright years. 2025-01-02 11:59:57 +01:00
gcc-interface.h Update copyright years. 2025-01-02 11:59:57 +01:00
getopt.h Update copyright years. 2025-01-02 11:59:57 +01:00
gomp-constants.h Update copyright years. 2025-01-02 11:59:57 +01:00
hashtab.h Update copyright years. 2025-01-02 11:59:57 +01:00
hsa.h libgomp: Enable USM for AMD APUs and MI200 devices 2024-05-29 15:29:06 +02:00
hsa_ext_amd.h non-gcc: Remove trailing whitespace 2024-10-25 10:03:17 +02:00
hsa_ext_image.h non-gcc: Remove trailing whitespace 2024-10-25 10:03:17 +02:00
leb128.h Update copyright years. 2025-01-02 11:59:57 +01:00
libcollector.h Update copyright years. 2025-01-02 11:59:57 +01:00
libfcollector.h Update copyright years. 2025-01-02 11:59:57 +01:00
libiberty.h Update copyright years. 2025-01-02 11:59:57 +01:00
longlong.h Update copyright years. 2025-01-02 11:59:57 +01:00
lto-symtab.h Update copyright years. 2025-01-02 11:59:57 +01:00
md5.h Update copyright years. 2025-01-02 11:59:57 +01:00
objalloc.h Update copyright years. 2025-01-02 11:59:57 +01:00
obstack.h Update copyright years. 2025-01-02 11:59:57 +01:00
partition.h Update copyright years. 2025-01-02 11:59:57 +01:00
plugin-api.h Update copyright years. 2025-01-02 11:59:57 +01:00
safe-ctype.h Update copyright years. 2025-01-02 11:59:57 +01:00
sha1.h Update copyright years. 2025-01-02 11:59:57 +01:00
simple-object.h Update copyright years. 2025-01-02 11:59:57 +01:00
sort.h Update copyright years. 2025-01-02 11:59:57 +01:00
spincount.h Update copyright years. 2025-01-02 11:59:57 +01:00
splay-tree.h Update copyright years. 2025-01-02 11:59:57 +01:00
symcat.h Update copyright years. 2025-01-02 11:59:57 +01:00
timeval-utils.h Update copyright years. 2025-01-02 11:59:57 +01:00
vtv-change-permission.h Update copyright years. 2025-01-02 11:59:57 +01:00
xregex.h non-gcc: Remove trailing whitespace 2024-10-25 10:03:17 +02:00
xregex2.h Update copyright years. 2025-01-02 11:59:57 +01:00
xtensa-config.h Update copyright years. 2025-01-02 11:59:57 +01:00
xtensa-dynconfig.h Update copyright years. 2025-01-02 11:59:57 +01:00