This is the mail archive of the
mailing list for the GDB project.
Printing allocatable v.s. normal arrays from fortran code in GDB
- From: Morten Olsen Lysgaard <morten at lysgaard dot no>
- To: gdb at sourceware dot org
- Date: Sun, 8 Feb 2015 22:53:35 +0100
- Subject: Printing allocatable v.s. normal arrays from fortran code in GDB
- Authentication-results: sourceware.org; auth=none
I am writing some scientific fortran code where I have some allocatable arrays.
When I want to print them in GDB, the data I get is gibberish, even
though the program itself easily can compute with the allocated array.
To demonstrate the problem I have created a small archive containing a
test program, a makefile and the output generated when run on my
The program is alloc.f90
The output is is output.txt
The program can be compiled and run by running make on a system with
Because the mailing list doesn't support attatchments the tarfile is
available at (1 Kb)
The interesting part is line 22-23 in output.txt. I would expect the
output on the two lines to be the same, but for some reason the
allocatable array is printed wrong.
Is this a known problem? Am I misunderstanding how allocatable arrays
work? Any help would be greatly appreciated.
GDB version: GNU gdb (Ubuntu 7.7.1-0ubuntu5~14.04.2) 7.7.1
gfortran version: GNU Fortran (Ubuntu 4.9.2-0ubuntu1~14.04) 4.9.2
Have a nice day - Morten