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

Viewing variables in a module while debugging (MSVS 2015)

avinashs
New Contributor I
298 Views

When debugging a subroutine contained within a module, the variables that are within the scope of that subroutine but not declared within the module subroutine are not visible with the debugger. This makes debugging very inconvenient if not impossible when using modules. Is there a setting that can make them visible or any other solution to this problem?

0 Kudos
2 Replies
andrew_4619
Honored Contributor II
298 Views

The normal behaviour is that only variables from the module that are used in the subroutine are visible. To add other variables to the watch list you need the syntax modulename::varname

If all module variables we all shown by default there would be too much information overload in many cases.

0 Kudos
Hayen__Jeffrey
Beginner
298 Views

I am assuming that you are working in an interactive debugging session:

Have you tried hovering the cursor over an occurrence of the variable in the procedure when stepping through the execution of that procedure? The variable name and its value(s) should immediately appear in a 'hover box' displayed at that location (much like a 'tooltip').

With modules, I have found that this technique always works with use association, but I have not tried it for host association.

0 Kudos
Reply