- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
When debugging code compiled with IFX it is not always possible to watch variables of derived types in QuickWatch (and it is not possible to set conditional breakpoints).
It seems like the type information of variables of derived types is sometimes wrong.
The attached example shows the problem: It is only possible to see the value of REC in either SUB1 or SUB2. I have tried different combinations of Visual studio and IFX.
Using IFORT it works fine.
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thank you for your report. I was able to test it internally, and indeed, there is an issue with values being displayed when debugging with IFX.
I have escalated this issue to our debugger team for a fix.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The fix for this issue will be available in the 2025.1 ifx release.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I downloaded 2025.1 of the Intel® oneAPI HPC Toolkit and compiled my code again. There are still a lot of variables which cannot be watched. This includes simple variables like integer.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Previously I have had a large number of debugger watch issues. Having been using 2025.1 since it came out and as yet have not seen any such problems. Maybe posting a small simple test project that shows the problem would be useful. There is maybe some option / style/ constructs that generate the problem.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Here is a small example.
What I did:
In Visual Studio I created a new fortran project of type "Main Program Code".
In the one and only source file that is created for the project I deleted all text and pasted the following lines:
===snippet============================================
PROGRAM CONSOLE
CHARACTER CTEXT*(5)
JNUM = 1
CTEXT = 'Hallo'
CALL DUMMY (JNUM,CTEXT)
END PROGRAM CONSOLE
SUBROUTINE DUMMY (JNUM,CTEXT)
CHARACTER CTEXT*(*),CTEXT1*(20)
CTEXT1 = CTEXT
JNUM1 = JNUM
RETURN
ENTRY DUMMY_2 (JNUM2)
JNUM3=JNUM2
RETURN
END
===snippet============================================
I built the program and set a breakpoint at the following line:
CTEXT1 = CTEXT
When I run the program then at this breakpoint everything is fine, both parameters to subroutine DUMMY (CTEXT and JNUM) can be watched in the debugger.
Stepping to the next line changes this: now neither CTEXT nor JNUM can be watched, but are "Undefined address".
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Dear Devorah,
since we switched from ifort to ifx in our company, we can no longer watch all variables in the debugger.
We have updated to version 2025.1 (compiling prints out ‘Compiling with Intel® Fortran Compiler 2025.1.0 [Intel(R) 64]...’):
Now we can watch significantly more variables than before.
However, we use a lot of old code and at least there it still doesn't work everywhere.
I have shortened the old code for an example so that the error still occurs and send it here. The community tried to help and I was able to improve my description and my example. However, the problem could not be solved - some have said that the problem does not exist for them, but firstly I am not sure whether they followed my description exactly, and secondly they did not specify the version of Visual Studio - we are using the current version, i.e. Visual Studio 2022, 17.13.6.
The issue is that function parameters cannot always be watched in the debugger.
For the example, I have created a new Fortran project, ‘Main Program Code’. In the file that is created automatically, I have deleted the code and inserted the following lines:
=======
PROGRAM CONSOLE
CHARACTER CTEXT*(5)
JNUM = 1
CTEXT = 'Hallo'
CALL DUMMY (JNUM,CTEXT)
END PROGRAM CONSOLE
SUBROUTINE DUMMY (JNUM_PARAM,CTEXT_PARAM)
CHARACTER CTEXT_PARAM*(*),CTEXT_VAR*(20)
CTEXT_VAR = CTEXT_PARAM
JNUM_VAR = JNUM_PARAM
PRINT *, CTEXT_PARAM
RETURN
ENTRY DUMMY_2
PRINT *, 'Hallo'
RETURN
END
======
If you now set a breakpoint before line 17:
PRINT *, CTEXT_PARAM
and then build and execute the code (x64), the variables CTEXT_PARAM and JNUM_PARAM are displayed as ‘Undefined address’ in the ‘Locals’ window in Visual Studio:
It would be very nice if the developers could take a look at this.
Cheers
Ignaz
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Many obsolete features but it seems to work.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Sorry, the variable names are confusing.
I cannot watch CTEXT and JNUM.
You watched CTEXT1 and JNUM1. What about CTEXT and JNUM? I can only watch them before the line
CTEXT1 = CTEXT
- 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
PROGRAM CONSOLE
implicit none
integer JNUM
CHARACTER CTEXT*(5)
JNUM = 1
CTEXT = 'Hallo'
CALL DUMMY (JNUM,CTEXT)
call dummy_2(JNUM + 100)
END PROGRAM CONSOLE
SUBROUTINE DUMMY (JNUM,CTEXT)
implicit none
CHARACTER CTEXT*(*),CTEXT1*(20)
integer JNUM,JNUM1,JNUM2,JNUM3
CTEXT1 = CTEXT
call DUMMY_2(JNUM1)
JNUM1 = JNUM
RETURN
end
subroutine ABC
implicit none
integer jnum2, jnum3
ENTRY DUMMY_2 (JNUM2)
JNUM3=JNUM2
RETURN
END
Microsoft Visual Studio Community 2022 (64-bit) - Preview
Version 17.14.0 Preview 4.0
With latest IFX shows all of the variables. I realize Steve will tell you it is not supported, it merely worketh.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I added some modern stuff, and amended the entry statements
CAn you put the Fortran into the proper text block so it shows correctly.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
You have to reach JNUM2 in the code to see the variable.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Andrew:
Is it not time that Fortran had a proper string variable of long length?
John
- 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
Thank you very much for your comments.
But please let me clear up a misunderstanding: When debugging code that is used in my company I first saw that variables are sometimes not displayed.
I then shortened this code as long as the problem still occurred. This resulted in the code snippet that I used in my message from 23 April 2025.
Even if the code is unattractive and should not have been used like this for a long time: there are thousands of lines of such old code in our company (and I bet in many other companies as well).
I would therefore very much appreciate it if the variables of this code were also displayed in the debugger.
- 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
Another misunderstanding: I can watch the variables where you are at in the debugger ("before line 'CTEXT1 = CTEXT'"). Step to the next line and you will not be able to watch the variables any more.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
If the carot is at line 14 , 15 or 17 I can still see all the vars a difference is JNUM goes grey for some reason. Do you see something different?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thank you. Here are three screenprints. The first one (where the debugger is before line 'CTEXT1 = CTEXT') shows that the variables can be watched:
On the second screenprint the debugger is at the next line and at first glance everything seems ok:
It seems that I can watch the variables, but there are these circles with arrows which mean "click to refresh". After clicking on both circles I took the third screenprint that shows that the variables are now unknown to the debugger:
I would like the developers at Intel to look into this. Therefore I will describe the problem again and also use other variable names for the parameters to avoid confusion. Moreover I will add a comment in the code to show at which line the debugger stops to show the variables. Do you have any other ideas how I can make the problem obvious?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Clicking the circular arrows is not required as jnum has come in as subroutine number, you cannot update it, if it is not updated in the subroutine. Why they have the circular arrows is beyond me, it has no useful purpose, but be annoying.
Hard rule, leave alone that which is weird.

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page