I think it would be really useful to add support for C99's VLA (variable-length arrays) and Fortran 90's arrays (i.e. arrays which use an array descriptor/dope vector).

While it does not seem as if the upstream version at sourceware.org will soon get it, Red Hat/Fedora has produced a patch which mostly supports them. As the branch is unlikely to get merged soon,* Debian should consider applying the patch manually - or using the Red Hat/Fedora version of gdb instead. (That's what some other distributions do.)


The VLA patch is available from the archer-jankratochvil-vla branch and also part of the archer-jankratochvil-fedora17 branch. See http://sourceware.org/gdb/wiki/ArcherBranchManagement

The GIT can be browsed at http://sourceware.org/git/?p=archer.git;a=summary

*Regarding the VLA merge into upstream, see http://sourceware.org/ml/gdb/2011-03/msg00021.html

And Fedora's version is developed at http://pkgs.fedoraproject.org/gitweb/?p=gdb.git;a=summary



With the patch, the result looks as follows:

(gdb) pt A
type = integer(kind=4) (2,-1:0)
(gdb) p A
$1 = (( 1, 2) ( 3, 4) )
(gdb) p A(2,-1)
$3 = 2
(gdb) p A(2,:)
$4 = (2, 4)
(gdb) p A(2:2,:)
$5 = (( 2) ( 4) )


for the following program:

integer, allocatable :: A(:,:)
allocate(A(1:2,-1:0))
A = reshape([1,2,3,4], [2,2])
print *, A
end


Tobias



--
To UNSUBSCRIBE, email to [email protected]
with a subject of "unsubscribe". Trouble? Contact [email protected]

Reply via email to