Current debugging support for allocatable and pointer arrays.

David Ham David.Ham@imperial.ac.uk
Tue Feb 5 15:26:00 GMT 2008


I am using gfortran 4.3 svn 132072 on Debian amd64 (this has just become 
the debian unstable version of gcc).

Previously (on 4.2) debugger support for allocatable, pointer and 
assumed shape arrays was broken in gdb fortran mode but by forcing c 
mode (set lang c) it was possible to access a structure containing a 
pointer to the data and some stride information.

With 4.3 this information appears to have gone and gdb only displays a 
memory address. It is not clear what this is the address of and gdb 
seems unable to display anything useful via this address. For 
information I am using GNU gdb 6.7.50.20080204-cvs which is the latest 
weekly snapshot.

As an example, field_name is of type varying_string from Townsend's 
implementation of iso_varying_string. Varying_string is therefore defined:

   type, public :: varying_string
      private
      character(LEN=1), dimension(:), allocatable :: chars
   end type varying_string

The relevant extract from the gdb session is then:

Current language:  auto; currently fortran
(gdb) print field_name
$1 = { ()}
(gdb) set lang c
Warning: the current language does not match this frame.
(gdb) print field_name
$2 = {chars = 0x3ee0900}

Any enlightenment would be most helpful. I haven't bug reported this 
because I'm not at this point sure it's not just me failing to find some 
relevant documentation on a change.

Many thanks,

David Ham

-- 
Dr David Ham
Applied Modelling and Computation Group,
Department of Earth Science and Engineering,
Imperial College London,

http://amcg.ese.ic.ac.uk/index.php?title=David_Ham



More information about the Fortran mailing list