public inbox for gdb@sourceware.org
 help / color / mirror / Atom feed
* Printing allocatable v.s. normal arrays from fortran code in GDB
@ 2015-02-08 21:54 Morten Olsen Lysgaard
  0 siblings, 0 replies; only message in thread
From: Morten Olsen Lysgaard @ 2015-02-08 21:54 UTC (permalink / raw)
  To: gdb

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
system.
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
gfortran installed.
Because the mailing list doesn't support attatchments the tarfile is
available at (1 Kb)
https://www.dropbox.com/s/zj4pgcbp44p5q4z/alloc.tar.gz?dl=1

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

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2015-02-08 21:54 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-02-08 21:54 Printing allocatable v.s. normal arrays from fortran code in GDB Morten Olsen Lysgaard

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).