Reputation: 29
I have been working on a Fortran code in visual studio 2022 using intel OneAPI compiler. The code is compiling correctly and it is running fine. Recently when I try to debug the code, I am unable to view the values of array variables in local or quick watch and get the message "undefined address" or "undefined variable xxx". Where xxx is a cell_obj type variable that is defined globally.
For Ex. cel(i)%nn - is the array for number density with "i" number of cells. When I want to look at the value at cel(30)%nn in quick watch I get the message "undefined variable cel". The code is running without any issues and all the output files are printed correctly. I can even see the value when I use print statements but not in quick watch during debug.
I have been using this code for my research last 2 years and never had this problem which has started occurring recently. I don't remember making any changes to the settings or the code. Also, based on some recommendations in other posts, I have ensured that the optimization is disabled and the project is running under debug configuration not release configuration.
I would appreciate any insight into this situation.
Thank you
Upvotes: 0
Views: 93
Reputation: 2484
There is a known issue with at least some versions of Visual Studio with debugging Fortran, related to symbol loading. I remember the symptoms being similar to those that are reported in this question.
The solution is to turn off an option to load symbols in an external process. To change this option, go to the Tools
menu, select Options
, expand the Debugging
item in the left-hand tree, select the General
ply, find "Load debug symbols in external process (Native only)", and turn it off.
A comment from Vladimir notes that a deleted comment mentioned something about interaction with breakpoints; I haven't seen such an issue in my own experience. I can set breakpoints in Fortran code freely with no changes to inspection of Fortran variables.
As I recall, I found this as either a KB or a forum thread on the Intel website when I was troubleshooting, so a search there with appropriate search terms may find more details.
Upvotes: 0