This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: PR37132 – RFC patch for generation of DWARF symbol for Fortran's namelists (DW_TAG_namelist)
- From: Cary Coutant <ccoutant at google dot com>
- To: Tobias Burnus <burnus at net-b dot de>
- Cc: gcc patches <gcc-patches at gcc dot gnu dot org>, gfortran <fortran at gcc dot gnu dot org>, Jakub Jelinek <jakub at redhat dot com>, Tom Tromey <tromey at redhat dot com>
- Date: Mon, 11 Nov 2013 10:18:13 -0800
- Subject: Re: PR37132 – RFC patch for generation of DWARF symbol for Fortran's namelists (DW_TAG_namelist)
- Authentication-results: sourceware.org; auth=none
- References: <527E3C96 dot 8030908 at net-b dot de>
> But for "USE mod_name, only: nml", one is supposed to generate a
> DW_TAG_imported_declaration.
>
> And there I am stuck. For normal variables, the DW_TAG_imported_declaration
> refers to a DW_TAG_variable die. Analogously, for a namelist one would have
> to refer to a DW_TAG_namelist die. But such DW_TAG_namelist comes with a
> DW_TAG_namelist_item list. And for the latter, one needs to have the die of
> all variables in the namelist. But with use-only the symbols aren't use
> associate and no decl or die exists. (Failing call tree with the patch:
> gfc_trans_use_stmts -> dwarf2out_imported_module_or_decl_1 ->
> force_decl_die.)
>
> What's the proper DWARF way of handling this? Creating a DW_TAG_namelist
> without any DW_TAG_namelist_items, relying on the debugger to pick those
> from the module? Or how is one supposed to handle it?
Why wouldn't you have DIEs for the imported namelist items? I'd think
that once the compiler has processed the USE statement and imported
the namelist into the current compilation unit, it would generate DIEs
for all the imported items, and then be able to construct a
fully-populated DW_TAG_namelist DIE. (At least it would have DIEs for
all the imported items that are actually used in that module, which
should be sufficient for debugging.)
-cary