multidimensional fortran arrays

Andrew Burgess aburgess@broadcom.com
Tue Sep 7 22:19:00 GMT 2010


The attached patch might fix the issue for you. It should apply cleanly to 7.2

I'll write a test and submit to the patches list in a couple of days. Let me know if you run into any problems.


Andrew



> -----Original Message-----
> From: gdb-owner@sourceware.org [mailto:gdb-owner@sourceware.org] On
> Behalf Of Mathew Yeates
> Sent: 07 September 2010 05:34
> To: Jan Kratochvil
> Cc: gdb@sourceware.org
> Subject: Re: multidimensional fortran arrays
> 
> gdb shouldn't claim to support gfortran until this  is fixed.
> Seriously, I cant print the value of a multidimensional  array?
> 
> On Thu, Sep 2, 2010 at 10:46 PM, Jan Kratochvil
> <jan.kratochvil@redhat.com> wrote:
> > On Thu, 02 Sep 2010 19:29:07 +0200, Mathew Yeates wrote:
> >> I mentioned this before but got no reply. So I have been getting the
> >> address of the array and using "x/f".
> >> But now I am using 4 dimensional arrays and this is getting old.
> >>
> >> Anyone have any ideas how to fix this? print myarray(1,2) -> "so
> such
> >> vec element"
> >
> > For some reason it really does not work even for static arrays.
> > program a
> >  integer :: v (2, 3, 4)
> >  v (:, :, :) = 10
> >  v (2, 3, 4) = 20
> >  v (2, 3, 4) = 20 ! line 5
> > end
> > (gdb) b 5
> > (gdb) r
> > (gdb) p v(2,3,4)
> > no such vector element
> >
> > It works on archer-jankratochvil-vla
> > (gdb) p v(2,3,4)
> > $1 = 20
> > available at
> >        http://sourceware.org/gdb/wiki/ArcherBranchManagement
> > (or Fedora releases) but the support has some other problems and I
> should
> > merge it to FSF GDB soon.
> >
> >
> > Thanks,
> > Jan
> >

-------------- next part --------------
A non-text attachment was scrubbed...
Name: arrays.patch
Type: application/octet-stream
Size: 3641 bytes
Desc: arrays.patch
URL: <http://sourceware.org/pipermail/gdb/attachments/20100907/43295d07/attachment.obj>


More information about the Gdb mailing list