This is the mail archive of the fortran@gcc.gnu.org mailing list for the GNU Fortran project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: gdb can't read dwarf-2 multidimensional array parameters


Mathew,

Mathew Yeates wrote:
> In the gdb session that follows the code, the "write" statement should
> not be executed. But gdb is setting the wrong location in the array.
> This happens because gdb does not know the size of the array. It
> thinks the array size is undefined.
[...]
> Note: This is not just a problem with line numbering.  The statement
> write(*,*)  'Boo'
> *does* get executed. (sorry. I left this out when I posted my original
> gdb session.

That latter is an important piece of information - because here it does
*not* get executed, cf. debugging setting below. That's with GCC 4.6
and an older Red Hat gdb. I can currently not test the GCC 4.3 or a
newer gdb to see whether it has been fixed in GCC 4.6 or whether it is
a gdb regression.

Tobias

PS: My debugging session looks as follows using GCC 4.6.0 20100928.

$ gdb ./a.out
GNU gdb (GDB) Red Hat Enterprise Linux (7.0.1-23.el5_5.1)
[...]
(gdb) b test.f90:5
Breakpoint 1 at 0x40075e: file test.f90, line 5.
(gdb) run
Starting program: /dev/shm/a.out

Breakpoint 1, foo (num_tau=10, num_mixture=10, gridded_resid_mask=...) at test.f90:5
5            if (Gridded_resid_mask(4,4)) then
(gdb) p Gridded_resid_mask
$1 = (( .TRUE., .TRUE., .TRUE., .TRUE., .TRUE., .TRUE., .TRUE., .TRUE., .TRUE., .TRUE.) ( .TRUE., .TRUE., .TRUE., .TRUE., .TRUE., .TRUE., .TRUE., .TRUE., .TRUE., .TRUE.) ( .TRUE., .TRUE., .TRUE., .TRUE., .TRUE., .TRUE., .TRUE., .TRUE., .TRUE., .TRUE.) ( .TRUE., .TRUE., .TRUE., .TRUE., .TRUE., .TRUE., .TRUE., .TRUE., .TRUE., .TRUE.) ( .TRUE., .TRUE., .TRUE., .TRUE., .TRUE., .TRUE., .TRUE., .TRUE., .TRUE., .TRUE.) ( .TRUE., .TRUE., .TRUE., .TRUE., .TRUE., .TRUE., .TRUE., .TRUE., .TRUE., .TRUE.) ( .TRUE., .TRUE., .TRUE., .TRUE., .TRUE., .TRUE., .TRUE., .TRUE., .TRUE., .TRUE.) ( .TRUE., .TRUE., .TRUE., .TRUE., .TRUE., .TRUE., .TRUE., .TRUE., .TRUE., .TRUE.) ( .TRUE., .TRUE., .TRUE., .TRUE., .TRUE., .TRUE., .TRUE., .TRUE., .TRUE., .TRUE.) ( .TRUE., .TRUE., .TRUE., .TRUE., .TRUE., .TRUE., .TRUE., .TRUE., .TRUE., .TRUE.) )
(gdb) p Gridded_resid_mask(4,4)
$2 = .TRUE.
(gdb) set Gridded_resid_mask(4,4) = .false.
(gdb) p Gridded_resid_mask(4,4)
$3 = .FALSE.
(gdb) p Gridded_resid_mask
$4 = (( .TRUE., .TRUE., .TRUE., .TRUE., .TRUE., .TRUE., .TRUE., .TRUE., .TRUE., .TRUE.) ( .TRUE., .TRUE., .TRUE., .TRUE., .TRUE., .TRUE., .TRUE., .TRUE., .TRUE., .TRUE.) ( .TRUE., .TRUE., .TRUE., .TRUE., .TRUE., .TRUE., .TRUE., .TRUE., .TRUE., .TRUE.) ( .TRUE., .TRUE., .TRUE., .FALSE., .TRUE., .TRUE., .TRUE., .TRUE., .TRUE., .TRUE.) ( .TRUE., .TRUE., .TRUE., .TRUE., .TRUE., .TRUE., .TRUE., .TRUE., .TRUE., .TRUE.) ( .TRUE., .TRUE., .TRUE., .TRUE., .TRUE., .TRUE., .TRUE., .TRUE., .TRUE., .TRUE.) ( .TRUE., .TRUE., .TRUE., .TRUE., .TRUE., .TRUE., .TRUE., .TRUE., .TRUE., .TRUE.) ( .TRUE., .TRUE., .TRUE., .TRUE., .TRUE., .TRUE., .TRUE., .TRUE., .TRUE., .TRUE.) ( .TRUE., .TRUE., .TRUE., .TRUE., .TRUE., .TRUE., .TRUE., .TRUE., .TRUE., .TRUE.) ( .TRUE., .TRUE., .TRUE., .TRUE., .TRUE., .TRUE., .TRUE., .TRUE., .TRUE., .TRUE.) )
(gdb) cont
Continuing.

Program exited normally.
(gdb)

Tobias


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]