1 (edited by JohnWasilewski 2014-02-08 09:35:51)

Topic: Warning: expressly disable all optimisation when debugging

Fellow users who haven't encountered this before, as I hadn't prior to SF2.10 (which I think introduces a code optimization selector that defaults to 'Common') might appreciate this warning.

When selecting 'Enable Debugging', in

   Options > Project > Code generation ,

it will generally be important to ensure that

   Aggressive loop optimizations is un-ticked,
   Optimization level is set to none.

This is because, with optimized code, two things will happen in debugging sessions which can make debugging very difficult.  One is that the debugger will not work through the program program source code line by line, just as the code is written, but will leap about in seemingly-incomprehensible ways.  The other is that many variables, which FORTRAN developers might need to watch during debugging sessions, will be reported as 'Optimized out'.

I've suggested that it might be best for enabling debugging automatically to kill all optimizing.  Jeff is considering it.
---
John