Quoted from DanRRight
I am shocked that almost no one uses debuggers... Or finding problems do not report them.
I have a different view of the role of a symbolic debugger than Dan, and perhaps many other users of FTN95 hold similar views. To me SDBG is one of many tools that are to be used in program development and debugging. Typically, it is a pleasant-to-use tool for (i) debugging small and medium programs, (ii) in the final stages of hunting down a compiler bug and (iii) understanding the structure of a program and relationships between subprograms, arguments, modules, etc. Given this view, I place a much higher priority on the quality of the compiler+linker+RTL than that of SDBG. The facilities provided by /check, /checkmate and /list are far more powerful than SDBG for debugging. Those are the features of FTN95 that make it one of the best compiler packages for debugging. I am happy to overlook deficiencies in SDBG if that will help focus effort on the compiler+linker+RTL.
Consider the variables pane. With a small program, all the variables fit into a medium size frame, and you can see all the variables at once. With a medium size program, you find yourself scrolling the variables pane to find the variables of interest. With a big program, if the variables are not sorted or if you cannot see them grouped by scope (module, common block, subprogram, etc.), it is so time-consuming to step over a CALL and then bring back the variable of interest (to see if/how it changed) that you have to start over and place a watch on that variable, instead. Or, revert to using PRINT statements for a few variables of interest.
Quoted from DanRRight
Both debuggers still tell 'Unknown Variable' if this variable was defined as a parameter as if this is not needed for user to be known. I am amazed by passive attitude of people: for 30 years no one reported this and many other similar problems
The compiler has to put in extra code to make PARAMETERs have a life in the EXE. Please remember that SDBG64 is quite new, and is getting better.
Here is an example to show that symbolic debuggers have limitations that the user should be aware of.
program sdbg_ex
implicit none
integer :: a=1, b=2, c=3, d=4, e=5,p,q
call sub(a,b,c,d,e,p,q)
print *,p,q
end program
subroutine sub(p,q,f,a,b,c,d)
implicit none
integer, intent(in) :: p,q,f,a,b
integer, intent(out) :: c,d
c=p+f+b
d=q+a
return
end subroutine
Compile with /debug /link and open in SDBG. Here are some things to watch for.
The first executable statement is highlited. In the Variables pane, you can see values for a, b, c, d and e. At this point, p and q are undefined, but you will see some junk values displayed. If you hover the mouse over the variables on any line in the main program, you see the same values pop up.
Without executing anything, hover the mouse over the variables in the subroutine. You will see values displayed for p, q, etc. with no respect for the fact that the p of the subroutine corresponds to the 'a' of the main program, etc. The subroutine variables are not in scope until the subroutine is entered, but the debugger happily displays 'values'. Behind the scenes, I suspect, SDBG simply finds the name of the variable under the mouse cursor and looks it up in the current symbol table, even though that symbol table does not pertain to SUB.
Hover the mouse over 'f' in the subroutine, and you will be told 'no debug information'. What is special about f? There is no variable named 'f' in the main program.