- 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
- « Previous
-
- 1
- 2
- Next »
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
At 17 it goes gray because it is inaccessible but not yet cleaned up by GC.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Well you see something entirely different to me. It is working OK on my setup IFX 2025.1.0 VS 2022 17.0.5
It is not clear what result John got because he changed the code but that seems to be working IMO.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Could you try with an up-to-date VS 2022 (17.13.6)?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
No I can't do that, sorry. I do not do VS updates they can break things in my experience and rarely have anything useful as a Fortran user. Maybe @JohnNichols could do that test he tends to use latest or preview....
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I cannot download test.zip it says, scanning for viruses. So please put the code up as a text block using the standard insert function. </> Function on second line of the tab bar.
I made minor changes to the code so I could single step through the code and not lose steps. This needed the entry put into a subroutine. And I added implicit none and declared the variables so I knew when they existed.
When I start the code and stop at first line
jnum is declared and is set to the standard open 0. and ctext is empty as expected.
Now we see text and integer filled in
then step into dummy
CTEXT1 is declared and empty, but jnum1 to 3 are not yet set at line 19
Teh next step is to line 24, which shows the declared varaibles set as zero except jnum that comes in as 1.
Line 25 sets a few variables
Step to entry dummy_2, and jnum2 is set to zero as declared.
now it steps to the subroutine, and jnum3 is undefined, but jnum2 is defined, it is a bit weird, the entry declares the varaible.
now the jnum3 is declared,
Normal variables, set to proper values,
more correctness
Even more correctness
now at entry jnum2 is undefined but known
jnum2 is declared and correct, jnum3 is undefined but known
defined.
Set all values.
but now we get garbage when it returns to the entry point.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Now the original
As expected
Now they are unknown to the subroutine
You are not at numbers yet so it knows it will need them, but has not set them.
jnum1 and 3 set to zero as expected and jnum2 is stuck at entry point as undefined, it knows it needs it but it is not set
JNUM2 is never reached
It never stops at 21.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The IFX debugger is a bit strange, but it does show all you need to know, why the circular arrows are there is strange and they do not return the correct value, but the gray value is the one brought in and it is correct.
I hope this helps.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
PROGRAM CONSOLE
implicit none
CHARACTER CTEXT*(5)
integer jnum
JNUM = 1
CTEXT = 'Hallo'
CALL DUMMY (JNUM,CTEXT)
END PROGRAM CONSOLE
SUBROUTINE DUMMY (JNUM_PARAM,CTEXT_PARAM)
implicit none
integer jnum_var, jnum_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
Please use the
Button to make the code nice and easy to read, it is a thoughtful thing for the reviewers.
Your code does not have implicit none or the numbers declared and as such you observe what you observe, but if I bring the code up to modern standards with implicit none then I get
Correct behaviour. It has been many years since I failed to use implicit none, it is very dangerous coding not to use implicit none, when you fix old code like ULARC UCB 1973, you see the mistakes, and these are a problem.
The debugger works it does not have errors, but your code is obsolete, do not expect a modern compiler to fix coding issues well.
It should be an error in Fortran not to use implicit none - Steve???
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Default implicit typing has been in the language forever. There is a work item for the next revision to make default implicit typing obsolescent, so if you asked for standards checking it would complain. One can always compile with /warn:declarations and that is the equivalent of putting IMPLICIT NONE in all program units.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Steve:
I have long memory of learning about implicit none and then finding that one cannot write sound Fortran without using this command.
It is too easy to type a variable name incorrectly and then you have a problem, it can be a subtle problem if the answers are close on a test case, but then become a problem later on in the code usage.
Of course it is a personal choice, but clearly the debugger team assumes that implicit none is in place or so it seems to me.
You only need to translate Old Fortran say 1968 to modern Fortran to know the first thing to do is put in implicit none and then look for the mistakes. Harrison's 72 is an example.
Stay cool
John
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
"Of course it is a personal choice, but clearly the debugger team assumes that implicit none is in place or so it seems to me. " Not so, it has no effect on the test case from the tests I made.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Putting aside all of the interesting stuff we have discussed, there is a clear difference in IFX and IFORT as to how it handles passed arguments once the debugger is inside the subroutine and we want to look at the passed arguments, as was advanced in original posts, if you hit the circular arrows the data for the arguments disappears in IFX and not in IFORT.
I would at least expect the same functionality in IFX. Perhaps Intel will make the change or we just learn do not touch the circular arrows. The popup message is in my humble opinion, incorrect, the values are known as they are passed.
This is the crux of the original posts.
- 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 for your further tests and comments.
I have also tested further in the meantime, namely with different versions of Visual Studio 2022:
17.0.23
17.8.20 and
17.12.4 (17.12.4 is the latest version of Visual Studio 2022, which is specified as ‘supported’ by Intel).
After the installation, I installed Intel® oneAPI HPC Toolkit (version 2025.1.1) from 30.4.2025.
In all tests, the behaviour is as I have already described, regardless of whether ‘implicit none’ is specified or not. In addition, if you only set a single breakpoint in the example code, namely in JohnNichols' code in line 21 (before “PRINT *, CTEXT_PARAM”), then you cannot watch the values of the variables - so the problem cannot be solved by not clicking on the circular arrows.
This thread has become very confusing. Therefore, I will open a new thread and describe the problem there again so that Intel can fix it.
Before that, I would like to know if there are still concerns from your side to report the problem to Intel so that the new thread does not become confusing again.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- « Previous
-
- 1
- 2
- Next »