Topic: Some feedback on debugging dynamic arrays in v2.19
I find this new feature works sometimes, but not always.
With the following code, the arrays a and n don't display properly in the Variables panel when a break is put on the print *, a line. However, they do display properly if you select the variables in the source code window and then point to them.
The Variables panel shows different wrong results for win32 and win64 targets (running on 64bit windows 8.1) and when using static vs. dynamic linking.
Strangely, once the print *, a has been stepped over, the values in the Variables panel change and become correct.
The array passed to pass_array always displays properly.
Edit: I have also found that it works correctly using gdb from a command window (outside Simply Fortran).
module mmm
contains
subroutine pass_array(a)
real, intent(in), dimension(:) :: a
! Check values (break here to look in debugger)
print *, a
end subroutine
end module
program main
use mmm
integer num
integer, allocatable :: n(:)
real, allocatable :: a(:)
num = 10
allocate(a(num), n(num))
! Populate arrays with 1 to num
a = (/(real(i), i=1, num)/)
n = (/(i, i=1, num)/)
! Check values (break here to look in debugger)
print *, a
print *, n
call pass_array(a)
end program
In some of my production code, I also see other parts of the dope vector that is used by gfortran to represent the deferred arrays in the Variables panel - parts which should be hidden, e.g. for a real variable x I see x.ubound (seems to be a C struct variable) with a value of *Indeterminate*. However, I have not been able to reproduce a test example for this behaviour and cannot post my production code.
David