Topic: Debugger acting weirdly

Been a while since I've used the debugger. I have a driver program and several subroutines that all compile OK. However, under the debugger, the cursor doesn't go right to the first executable statement in the driver; it jumps to another statement further down. When I subsequently use the "step" key, F9, the cursor then just jumps around randomly. Anyone know why this happens and how to make the debugger behave?

Re: Debugger acting weirdly

The jumping occurs for two well known reasons:

1. Presence of ALLOCATABLE variables - the debugger doesn't quite understand where the "executable" line for allocatable variable declarations exist, so it tends to jump to the end of the procedure before jumping back to the line with the variable. 

2. Presence of implicit variables - because these variables are not declared, the compiler has generated some sort of declaration for you in your code upon compilation.  Their presence seems to cause a similar issue as with the ALLOCATABLE variables, appearing to jump around before stepping through the procedure cleanly.

There might be a handful of other reasons as well.  The issue is deep inside the compiler and its generation of debugging information.  I'd have to look into it more deeply, but it might not be fixable.

Jeff Armstrong
Approximatrix, LLC

Re: Debugger acting weirdly

Thank you for your reply. I did use IMPLICIT REAL and IMPLICIT INTEGER statements in my code, thinking that including them was good practice. Perhaps this was overkill and I should just delete them since most FORTRAN versions I know about usually assume any variable name starting with I thru M is INTEGER by default?

Re: Debugger acting weirdly

The debugger will act similarly in the presence of any implicit variables.  Using the IMPLICIT statement doesn't change this fact (unless, of course, you use IMPLICIT NONE).  So just removing the statements will not resolve the behavior.

Jeff Armstrong
Approximatrix, LLC