[Dwarf-Discuss] Dwarf-Discuss Digest, Vol 72, Issue 3

Bishop, John E john.e.bishop@intel.com
Mon Nov 18 16:58:51 GMT 2013

   Question: Would it be permissible to create a DW_TAG_imported_declaration
   for a DW_TAG_namelist with an empty DW_TAG_namelist_item list and rely on
   the compiler to fetch the namelist items from the module's DW_TAG_namelist?

I think if you are importing, you don't even need the DW_TAG_namelist:

  DW_TAG_imported_declaration '/nml'
    DW_AT_import DW_FORM_ref_addr [ reference to other file's DWARF ]

I'm a bit weak on how that cross-file reference works, but reading section 3.2.3
that's what I come up with.

I wish "my" compiler generated namelist entries, but it doesn't and so I 
can't point to a worked example.  I append my understanding of what you
would do with the suggested fix above.


---[ file 1 ]---

module mm
integer :: ii
real :: rr
NAMELIST /nml/ ii, rr
end module mm

---[ sketch of DWARF for file 1 ]---

DW_TAG_module 'mm'
  DW_TAG_variable 'ii'
  DW_TAG_variable 'rr'
  DW_TAG_namelist '/nml'           <--- $1
    DW_TAG_namelist_entry 'rr'
    DW_TAG_namelist_entry 'ii'

---[ file 2 ]---

subroutine read_nml()
use mm, only: nml
read(99, nml=nml)
end subroutine read_nml

---[ sketch of DWARF for file 2 ]---

DW_TAG_subprogram 'read_nml'
  DW_TAG_imported_declaration '/nml'
    DW_AT_import DW_FORM_ref_addr [ somehow a reference to $1 ]

---[ end ]---

More information about the Dwarf-discuss mailing list