Sorry, I've only checked this in ddd, but after switching back to gdb-6.8-r2 all is working again. Reproducible: Always Steps to Reproduce: 1. ddd program 2. Set breakpoint in subroutine 3. Try to print part of a dummy array Actual Results: Print no such vector element Expected Results: Print out of array part that one attempted to print. See above.
Testcase would be nice with step-by-step walkthrough of what you're doing.
Try this little program: program test c Testing gdb for printing arrays double precision C(4,4) do J = 1, 4 do I = 1, 4 C(I,J) = dble(I+J) end do end do call sub(C, 4) stop end subroutine sub(C, IDC) double precision C(IDC,*) print '(''C(1,1), C(4,4):'', 1P, 2E12.5)', C(1,1), C(4,4) return end gfortran -ggdb -o test test.f gdb test b 14 r p c(4,4) c quit Note that the debugger prints 5 for c(4,4) while it should print 8.
Since I've had a lot of system updates, I've tried this again, and things have changed for some reason. Now instead of printing the wrong value, it prints "no such vector element". It does this even at the point of the subroutine call. It does do "p c(4,1)@5" correctly (that is it prints (5, 3, 4, 5, 6)), but will not print c(5,1), or c(1,2). I have now filed a bug at the gdb site.
upstream is working on the issue http://sourceware.org/ml/gdb-patches/2009-01/msg00251.html http://sourceware.org/ml/gdb-patches/2010-03/msg00443.html