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?
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.
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.