I have often observed that when code is compiled with /64 and /check or /checkmate and run from SDBG64, the lines that can be breakpointed are often messed up. Today I found an example code that is short and easy to follow.
When I compile and open the program in SDBG64 8.50, I find that only two lines in the subroutine admit a breakpoint: Lines 16 (the declaration of the dummy argument A) and 38 (the last statement of the program) are displayed with a dot in column-1.
If the program is compiled with /64 and /checkmate and run, the program stops with 'undefined...' on the END statement of the subroutine. I am using the 8.51 compiler.
A related request: when an undefined variable is detected, the debugger or the error message only divulges the line number where the problem occurs. It would be nice to have the name of the undefined variable displayed as well, since otherwise one has to look up each variable in a lengthy expression to ascertain which element of the expression is undefined.
The test code:
program xdgemv
implicit none
double precision a(1,1),x(1),y(1),alpha,beta
alpha = 1d0
beta = 0d0
x(1) = 4d0
call dgemv('n',1,1,alpha,a,1,x,beta,y)
print *,y
end program
subroutine dgemv (trans, m, n, alpha, a, lda, x, beta, y)
implicit none
double precision alpha, beta
integer lda, m, n
character*1 trans ! not used, but needed to reproduce bug
double precision a( lda, * ), x( * ), y( * ), temp
double precision, parameter :: one = 1.0d0, zero = 0.0d0
integer j, jx, kx, leny
leny = m
kx = 1
if( beta.ne.one )then
if( beta.eq.zero )then
y(1:leny) = zero
else
y(1:leny) = beta*y(1:leny)
end if
end if
if( alpha.eq.zero ) return
jx = kx
do j = 1, n
if( x(jx).ne.zero )then
temp = alpha*x(jx)
y(1:m) = y(1:m) + temp*a(1:m,j)
end if
jx = jx + 1
end do
return
end