> 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