On Wed, Oct 26, 2022 at 10:17:26AM +0200, arthur.co...@embecosm.com wrote: > @@ -25201,6 +25215,13 @@ gen_compile_unit_die (const char *filename) > } > else if (strcmp (language_string, "GNU F77") == 0) > language = DW_LANG_Fortran77; > + else if (strcmp (language_string, "GNU Rust") == 0) > + { > + if (dwarf_version >= 5 || !dwarf_strict) > + language = DW_LANG_Rust; > + else > + language = DW_LANG_Rust_old; > + }
I must say I don't understand nor like this DW_LANG_Rust_old stuff at all. Other languages don't do similar dances. Look for D, or Go. Neither of them has any non-standard lang code as fallback, they use the DWARF assigned DW_LANG_* code, and DW_LANG_C as fallback. On most arches, DWARF 5 is the default anyway, or non-strict DWARF at least. Where neither is enabled because of prehistoric or buggy DWARF consumers, it is unlikely they'd handle Rust sanely anyway. Just follow what Go does in the same function. Jakub