This is the mail archive of the
fortran@gcc.gnu.org
mailing list for the GNU Fortran project.
Re: [PATCH] Fortran DW_TAG_module/DW_TAG_imported_{declaration,module} support, improved DW_TAG_common_block support
- From: Jakub Jelinek <jakub at redhat dot com>
- To: Tobias Burnus <tobias dot burnus at physik dot fu-berlin dot de>
- Cc: Jason Merrill <jason at redhat dot com>, gcc-patches at gcc dot gnu dot org, fortran at gcc dot gnu dot org, Jan Kratochvil <jkratoch at redhat dot com>, Daniel Jacobowitz <dan at codesourcery dot com>
- Date: Thu, 21 Aug 2008 21:51:04 +0200
- Subject: Re: [PATCH] Fortran DW_TAG_module/DW_TAG_imported_{declaration,module} support, improved DW_TAG_common_block support
- References: <20080821191221.GA4737@physik.fu-berlin.de>
- Reply-to: Jakub Jelinek <jakub at redhat dot com>
On Thu, Aug 21, 2008 at 09:12:28PM +0200, Tobias Burnus wrote:
> > Attached is an updated patch (and interdiff from the last posted patch),
> > which leaves this compatibility cruft only to C++ and lets Fortran
> > define stuff inside of DW_TAG_module.
>
> Thanks, the test case is now handled properly. However, I have found
> that now module variables outside the only clause "ONLY:" do not work.
>
> Assume the following module:
> ----------------------
> module m
> implicit none
> real :: i,k,z
> end module m
> ----------------------
>
> (a) Then the following works now:
> use m, only: j=>i ! and also: "only: i" w/o renaming
> integer(8) :: i ! or "only: j=>i, z=>i" work
> j = 5.0
> i = 7
>
> (b) However, the following does not:
> use m
> i = 5.0
> k = 10.0
> z = 19.0
> print *, i, k, z
That sounds like an idb bug, IMHO the Dwarf3 standard is quite clear
that for use m only DW_TAG_imported_module with DW_AT_import @DW_TAG_module
is enough, no DW_TAG_imported_declaration are needed. It seems
ifort emits DW_TAG_imported_declaration for all use_assoc vars, not
DW_TAG_imported_module, so perhaps idb just handles what ifort implements.
Can you try say:
module modZ
integer :: i, j, k, l
contains
subroutine init
i = 1
j = 2
k = 3
l = 4
end subroutine init
end module modZ
use modZ
call init
print *, i, j
end
with ifort/idb and see whether you can see in the debugger all i, j, k, l
values or just i and j inside of MAIN__? The right behavior is to be able
to print them all. I hope gdb will implement this correctly...
Jakub