- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I was having issues with being able to view variables in Debug in VS 2022 v 2026 in certain subroutines
and couldn't figure out why?
did the ole 'all CAPS' but didn't fix it...
and then i noticed/discovered that
in VS 2022/2026
IF you use ONLY to specify the ONLY variables in a MOD used in a subroutine
then in DEBUG
VS will NOT display the variable value and in Watch window is will say undefined!
Once i commented out all ONLY specifications
Then ALL variables used in the subroutine reveal their values!
strange?
Or is this the appropriate behavior with 2026/2022
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
With update out and some folks saying things not working and since i started this topic
I tested (why not gamble, eh?!)
DEBUG WATCH/CHECK VARIABLE VALUES WORK
Test run on my win10 computer (so expect all will work on my win11 computer too which i will check later or tomorrow)
- Visual Studio 2026 18.5.2
- INTEL Fortran 2026.0.0.566
- FEE_VSIX_V17
A right mouse hover over a variable produces variable value if Module without USE statement
Module name::Variable lists value in watch window for Modules with USE statement
BRAVO!
Great work INTEL!
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
May you please review this with VS integration team at Intel, perhaps in conjuction with the Fortran compiler team?
Please consider the attachment here and illustration below as a minimal reproducer the Intel team can utilize.
To add to OP's post, please consider a trivial module file m.f90 in a Visual Studio project as follows:
module m
integer :: a = 42
integer :: b = 24
end module mAnd a consuming program like so:
use m, only : a
print *, a
endAs mentioned by OP, the USE statement with ONLY clause masks the object in the debugger:
Whereas without the ONLY clause, the debugger identifies the object - see below:
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
May you please consider a variant of the above case for a quick review with Intel team and comment here?
Consider the module to employ PRIVATE/PUBLIC attributes to control visibility and USEability:
module m
private
integer, public :: a = 42
integer :: b = 24
end module mNow, similar to IFORT and earlier versions of Visual Studio, one can utilize "qualified" names of objects viz. module_name::object_name to watch the objects in the debugger. Interestingly this facility ignores the Fortran language PRIVATE/PUBLIC attributes which can be bothersome to some working in the proprietary codebase.
Are the above two aspects as Intel software teams have intended?
Thank you,
P.S.> A team I work with reported this issue to me upon seeing the original post. The issue is of great concern and it will be highly beneficial if the VS integration team can include a fix for this as soon as possible.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello,
Sorry i missed your responses yesterday.
Once back in my cage (aka the office) i will test and give response early next week (you know how Mondaze Mondaze go...)
Thank you for the response and ideas and will get back to you soon
Have a great weekend!
b
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
now back in office i see Fortranfan clarified what i had posted so looking forward to seeing Intel's response.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi, I did reproduce your observation about the private/public attributes, but couldn't reproduce that with "only"
It still can show the value of a, even I have the "only" specifier in front of it. Did I miss anything ? Do you have the Intel Fortran Expression Evaluator installed ?
I'm using VS2026 and ifx 2025.3.2.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I haven't tried the public/private
- guess i mainly use the ONLY so i know/specify which modules variables come from
however
- if I specify in the watch window
- module::variable
- it does show in the watch window
However,
In my debug trials and tribulations I prefer/need/want to be able to simply right click and view the variable value
VS 2022 (Version 17.14.29 (March 2026))
VS2026 (just now updated to 18.4.3)
also Intel® Fortran Compiler 2025.3.3 [Intel(R) 64]
- if i use ONLY on a variable in a module i can only see values in the Watch window and not with the right mouse click
- whereas if i remove the ONLY from modules then i can see the values of any of the variables used in the subroutine or program unit with a simple right click of the mouse
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi, Please continue to use module::variable in the watch window as a workaround.
I can reproduce your observation now if I only enter "a" instead of "m::a" in the watch window. And if you hover the cursor above the variable during debug, it doesn't show its value. This is indeed somewhat inconvenient.
As far as I can understand now, this seems a deliberate design in the compiler, that for code "use m, only : a", no new variable is created, instead it's replaced with "m::a" during compile time and that's why you see the error "Undefined variable a" when trying to see its value.
I have escalated this issue to the compiler team and will get back once I get any updates.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thank you for looking at this and the explanation. I too suffer from this and it does indeed impact quite significantly on productivity when debugging. I was now aware of the ONLY issue I thought is was all module variables. This was because I generally ONLY use ONLY i.e. in 99% of cases. At least I can make a temporary edit to use "all" for specific debug activities as a workaround, that is still a pain because when hunting for where a problem happens I use 'hover' until I have homed in of some specific routine.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi, I have some updates that the issue has been fixed with the 2026.0 release. Please verify when the package goes public.
Right now, the variable "a" can be resolved in watch window, it also shows up in the locals window and when you hover your cursor on it.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I also had issues with watching variables in debug if specifying "use module, only : var" with VS2022 17.4.x , Intel 2025.3, and FEE 2025.2.2. We also lost the ability to hover over the variable to see the values.
I got the 2026.0 compiler installed last week and the behavior is now worse than 2025.3. Now all module variables, including ones with no "module, only" designation are showing up as undefined. I deleted my .VS folder, full clean build, all extensions up to date, IFEE still latest available as 2025.2.2. Attached is a snapshot of a very simple sample code.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hey, I’ve seen something kinda similar in VS before, so your confusion makes sense.
What you’re running into is basically how the debugger handles scope + compiler optimization when you use ONLY in a module. It’s not really “breaking”, but it does feel like it because debug visibility gets weird.
I had a case in VS2022 where I thought variables were just not being passed correctly, but turns out the debugger simply wasn’t exposing them due to how the compiler was treating that restricted scope. When I removed or loosened the ONLY list, suddenly everything appeared again in Watch window.
What worked for me:
Try compiling with Debug config (not Release optimized)
Avoid heavy ONLY filtering inside modules you actively debug
Use explicit local copies inside the subroutine if needed
Sometimes rebuilding solution clears stale debug symbols too
It’s one of those “technically expected behavior, but still confusing” things in VS.
Not sure if it’s improved in newer builds or still same in 2026 version, but yeah, you’re not imagining it.
By the way, I’ve also hit similar quirks while testing small modules in my own projects under “U-Shop” dev setup — debugging scope can really mess with visibility sometimes.
Have you tried isolating it in a minimal repro project to confirm it’s ONLY-related?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
With update out and some folks saying things not working and since i started this topic
I tested (why not gamble, eh?!)
DEBUG WATCH/CHECK VARIABLE VALUES WORK
Test run on my win10 computer (so expect all will work on my win11 computer too which i will check later or tomorrow)
- Visual Studio 2026 18.5.2
- INTEL Fortran 2026.0.0.566
- FEE_VSIX_V17
A right mouse hover over a variable produces variable value if Module without USE statement
Module name::Variable lists value in watch window for Modules with USE statement
BRAVO!
Great work INTEL!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
unfortunately it isn't 100% working
on a project it wouldn't reveal the values etc
have not yet tested on win11 will do so today
but progress is made as it does work in some instances and if i can isolate WHY it doesn't work in others, i will post up a sample for INTEL to take a look/see at
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi B, just to clarify, did you clean your solution and recompile with 2026.0? Because the behavior your describing is the behavior we saw in 2025.3 and without a clean it might not actually be recompiling. In 2026.0, all module variables cannot be hovered over and all module variables require Module::var in the watch window even if they are within scope from the use module statements. This is a severe debugging regression we are seeing from switching from ifort.
In my picture are side by side watches of 2025.3 and 2026.0.
1. Red boxes: In 2025.3 if a module variable was set within the same file as the subroutine making a "use module, only :" statement, then that variable was watchable with hover over or in the watch window WITHOUT "module::var". No longer working in 2026.0.
2. Blue boxes: (worse in 2026.0) In 2025.3 not using the ", only :" statement allowed us to hover over and watch values without "module::var". In 2026.0, this now appears to also be undefined and we cannot hover over the variable.
3. Green boxes: In both 2025.3 and 2026.0 you cannot hover over nor watch any module variable if its included in a "use module, only:" statement. All module variables require "module::var".
We should be able to watch all module variables that are within scope without having to manually type in "module name::var" into the watch window like we were able to in ifort.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Just for completion sake, I have also attached an image of the same sample solution watch behavior in oneapi 2023 ifort. Everything within scope of the subroutine is easily watchable with or without module::var and everything can be hovered over.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
as i recall you are using an older version of Visual Studio? 17.14.25
you might update visual studio to latest?
Recall i am using
- VS 2022 (Version 17.14.29 (March 2026))
- VS2026 (just now updated to 18.4.3)
- also Intel® Fortran Compiler 2025.3.3 [Intel(R) 64]
i did recompile all with latest compiler after clean (from menu)
when have chance later will be sure fully cleaned out the directory etc (i recall back in the day clean did not entirely clean all out...so will double check)
b
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
wish this had ability to edit (like phpBB Forums do!)
i'm using
- Visual Studio 2026 18.5.2
- INTEL Fortran 2026.0.0.566
- FEE_VSIX_V17
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Tested on Win11
and then re-tested on Win10
with 2 separate projects
and both behave the same (so far and this is a quick look/check)
Some initial observations:
- You need to remove ONLY and can ONLY look at variable values MODULENAME::VARIABLENAME in watch window
- Case does not matter (upper/lower case is fine in variable and watch window)
- Local variables values can be checked with right mouse click
- Module variables only can be viewed in Watch window
- One minor issue (for me) with one of my programs:
- I use equivalence to be able to reset to 0 entire modules (rather than individual elements) (from program written a while ago)
- ONLY the array variable equivalenced to the individual variables is viewable in the subroutine
- For examples if you have a module with 50 variables and you equivalence each of those 50 variable names to an array All_VARIABLES(1:50)
- (so you can simply set ALL_VARIABLES(1:50) to 0
- in Subroutines you can ONLY watch elements in ALL_VARIABLES(1:50) NOT the individual variable names
- I use equivalence to be able to reset to 0 entire modules (rather than individual elements) (from program written a while ago)
- One minor issue (for me) with one of my programs:
Still checking things but it appears to work as expected except individual module elements ONLY in watch window
and apologies for TMI and not reading release notes since all this may be obvious/documented!
More checking soon (but cage being rattled so need to get back to project work!)
B
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page