Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
29067 Discussions

Debugger gets confused by several variables with same name

uha
Novice
366 Views

I have a problem with the debugger in some cases displaying no or wrong values. E. g. inside a loop i=1..n the debugger may display n=0 and i=4. Other times it claims the variable is an "Undefined pointer/array" even though the variable is neither pointer nor array. I strongly suspect it gets confused when there is more than one variable with the same name, although the "wrong" variable could be a local in a different function or a private in a different module. I tried with one case and renamed the variable to something globally unique, then debugging worked as expected.

Also "Go To Definition" frequently takes me to an unrelated definition of some variable that has the same name. In ifort this has never happened, it would either not work at all or take me to the correct place.

I have tried, but not succeeded to create a reproducer - not sure if such an example is just too small, or the  issue is related to certain compiler settings or specific conditions in the code...

I am aware it is difficult to provide advice with such unconcrete information, but maybe someone has an idea what to try or how to further investigate? Or just confirm this is a problem for others, too?

I´m now using ifx version 2024.2.1, but the problem was there with previous ifx versions.

 

 

Labels (1)
0 Kudos
0 Replies
Reply