This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH] Multi-dimensional Fortran arrays issue PR11104
On Tue, 23 Nov 2010 18:23:24 +0100, Jan Kratochvil wrote:
> dimension a(10)
> call sub(a,10)
> end
> subroutine sub(a,n)
> dimension a(n)
> a(5) = 5
> end
>
> (gdb) b 6
> (gdb) run
> (gdb) p a(5)
> Subscript number 1 out of bounds, range 1 to 1
BTW I intended to show it for arrays with undefined length such as:
dimension a(10)
call sub(a,10)
end
subroutine sub(a)
dimension a(*)
a(5) = 5
end
FSF GDB recognizes the dynamic length (former example) as undefined length
type = real(kind=4) (*)
while FSF GDB recognizes the undefined length (latter example) as -1
type = real(kind=4) (-1)
which does not work in any case.
For VLA GDB the former example gets the correct length
type = real(kind=4) (10)
while VLA GDB recognizes the undefined length correctly:
type = real(kind=4) (*)
So that your patch could be compatible with both.
Thanks,
Jan