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

Module-level variables not visible in debugger in Visual Studio 2022 v17.7

MDThomas
初学者
3,931 次查看

I am running into an issue debugging Fortran code in Visual Studio 2022 version 17.7 with the Intel oneAPI v2023.2.1 compiler. Module-level variables are not appearing as visible (or are showing incorrect values) in the debugger when stopping at a breakpoint in a subroutine of that module. However, variables that are locally-defined in the subroutine are visible, as are those variables imported with the “use” command. This problem appears to be specific to VS2022 version 17.7 since I did not have this problem with my previous installation of version 17.4 with the oneAPI v2023.0.0. 

0 项奖励
12 回复数
andrew_4619
名誉分销商 III
3,918 次查看

Module Variables that are referenced are usually viewable but I have known glitches in that using 'module-name'::'variable-name'  in the watch window can be used as a workaround and for vars not currently directly referenced in the routine. 

0 项奖励
MDThomas
初学者
3,811 次查看

Hi Andrew. Thank you very much indeed for your response. Your workaround works and I can now view the variables in the watch window using the syntax you suggested. This will certainly help for the time being. When you have encountered the same problem, do you know if there was a way of fully resolving the issue? Or did you simply wait for an updated version of the program? Thank you again. 

0 项奖励
Barbara_P_Intel
3,802 次查看

There is a preview update of VSIX installer for the latest FEE Visual Studio extension for VS 17.7.x that fixes some debugger issues. I do not know if this issue addressed. See this thread for more information.

If you still have an issue, please post a reproducer.

FYI... this article lists the VS versions that we validate for each release. 

 

0 项奖励
wangxla
初学者
3,739 次查看

wow, the method was used for my problem.Thank you very much!

 

0 项奖励
MDThomas
初学者
3,690 次查看

Hi wangxla. Which problem was fixed for you: the problem I described in my initial post at the top, or the one posted in this thread? Thanks for any information. 

0 项奖励
MDThomas
初学者
3,691 次查看

Thank you for the reply. I have just been able to try the VSIX installer you provided a link to, but unfortunately this has not corrected the issue I am having with the module-level variables not being visible in the debugger. Thanks again, though.  

0 项奖励
Robert_Adams
新手
2,752 次查看

Hi MDThomas,

 

Were you able to find a solution to this problem?  I am seeing the same behavior and haven't been able to find a solution.

 

Thank you.

0 项奖励
Ron_Green
主持人
2,710 次查看

We are reworking the debugger and the compiler symbols for the 2025.0 release, due in November.  There are a whole series of use cases and fixes for each underway.  If you have a simple example that you can attach we'd be happy to examine it and see if it's covered by the work underway. And if not, we'll get a bug report started.

jimdempseyatthecove
名誉分销商 III
1,538 次查看

>>We are reworking the debugger and the compiler symbols for the 2025.0 release, due in November. 

Great!

For now, I've had to resort to using ifort for debugging.

 

Not sure if this is on your to-do list for debugging:

 

In a contained procedure, the variables in the containing procedure (used in the contained procedure) are not visible.

subroutine foo
  real :: var
  ...
contains
subroutine bar
  real :: X
  ...
  var = var + X ! var not visible
end subroutine bar
end subroutine foo

You can view the variable by setting the scope up one level, but this is a PIA.

Jim Dempsey 

0 项奖励
yudtu
新手
1,687 次查看

It seems the problem is still not fixed. 

I use module, and within a subroutine, I use this%... When I debug, I can not watch the this varible. It is not avaiable. 

0 项奖励
yudtu
新手
1,582 次查看

I also have a follow-up: when using the same program, I switched to the IFORT (Intel Fortran Compiler Classic), and it works as expected. Additionally, I can monitor some variables at the module level. However, the program does not produce the same results when compiled with IFX. It reports bugs, making it difficult to troubleshoot, especially since I cannot monitor the variables effectively.

0 项奖励
回复