http://dwarfstd.org/Dwarf3.pdf "4.3 Namelist Entries" "A namelist is represented by a debugging information entry with the tag DW_TAG_namelist. If the namelist itself has a name, the namelist entry has a DW_AT_name attribute, whose value is a null-terminated string containing the namelist’s name as it appears in the source program. "Each name that is part of the namelist is represented by a debugging information entry with the tag DW_TAG_namelist_item. Each such entry is a child of the namelist entry, and all of the namelist item entries for a given namelist are ordered as were the list of names they correspond to in the source program. "Each namelist item entry contains a DW_AT_namelist_item attribute whose value is a reference to the debugging information entry representing the declaration of the item whose name appears in the namelist." Example: integer :: aa,bb namelist /nml/aa,bb bb=2 end gfortran -g test.f90 readelf -wi a.out -> no DW_TAG_namelist
Draft patch: http://gcc.gnu.org/ml/gcc-patches/2013-04/msg00560.html
For gdb-support, see http://sourceware.org/bugzilla/show_bug.cgi?id=15353
(In reply to comment #1) > Draft patch: http://gcc.gnu.org/ml/gcc-patches/2013-04/msg00560.html The draft patch fails for dummy arguments as the shipping comes to early: There is no die to be referenced for them. Thus, the generation of DW_TAG_namelist has to be deferred until the full function decl is available. The current idea is to add a NAMELIST_DECL to BLOCK_VARS in tree.def, similarly to IMPORTED_DECL. DECL_NAME will then contain the the namelist /name/ - and the decl the vector with all decls in that namelist. See C++ for how IMPORTED_DECL gets filled - and "grep IMPORTED_DECL" which files are affected (including LTO!).
New draft patch: http://gcc.gnu.org/ml/gcc-patches/2013-06/msg00534.html
Updated patch: http://gcc.gnu.org/ml/fortran/2013-11/msg00060.html DWARF question asked (accessrequires subscription) http://lists.dwarfstd.org/private.cgi/dwarf-discuss-dwarfstd.org/2013-November/001289.html http://lists.dwarfstd.org/private.cgi/dwarf-discuss-dwarfstd.org/2013-November/001290.html
Author: burnus Date: Wed Dec 4 19:59:42 2013 New Revision: 205679 URL: http://gcc.gnu.org/viewcvs?rev=205679&root=gcc&view=rev Log: gcc/ 2013-12-04 Tobias Burnus <burnus@net-b.de> PR debug/37132 * lto-streamer.h (LTO_tags): Add LTO_namelist_decl_ref. * tree.def (NAMELIST_DECL): Add. * tree.h (NAMELIST_DECL_ASSOCIATED_DECL): New macro. * tree.c (initialize_tree_contains_struct): Add asserts for it. * dwarf2out.c (gen_namelist_decl): New function. (gen_decl_die, dwarf2out_decl): Call it. (dwarf2out_imported_module_or_decl_1): Handle NAMELIST_DECL. * lto-streamer-in.c (lto_input_tree_ref): Handle NAMELIST_DECL. (lto_input_tree_ref, lto_input_tree_1): Update lto_tag_check_range call. * lto-streamer-out.c (lto_output_tree_ref): Handle * NAMELIST_DECL. gcc/fortran 2013-12-04 Tobias Burnus <burnus@net-b.de> PR debug/37132 * trans-decl.c (generate_namelist_decl, create_module_nml_decl): New static functions. (gfc_generate_module_vars, generate_local_vars): Call them. (gfc_trans_use_stmts): Handle namelists for debug genertion. Modified: trunk/gcc/ChangeLog trunk/gcc/dwarf2out.c trunk/gcc/fortran/ChangeLog trunk/gcc/fortran/trans-decl.c trunk/gcc/lto-streamer-in.c trunk/gcc/lto-streamer-out.c trunk/gcc/lto-streamer.h trunk/gcc/tree.c trunk/gcc/tree.def trunk/gcc/tree.h
FIXED on the 4.9 trunk.