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

Debugger not showing values of arrays or module variables

jirina
New Contributor I
1,159 Views

I am debugging my (Fortran) application using the latest versions of Base Kit and HPC Kit, both of them reinstalled after installing Windows updates, and if I add an array or a module variable (module::variable) to Watches, I get an error "Undefined variable" instead of their value(s).  Local variables are OK.

 

Also, pressing F11 (Step Into) on a row with a subroutine (X) call moves the cursor to the first row of the subroutine containing the call to the subroutine (X), multiple times. After the subroutine (X) is finally stepped into, the cursor is placed on a row with a N-th statement, with genrally N>1. In the subroutine (X), even local variables' values are not shown in Watches; I see "Undefined variable".

 

I tried rebuilding the solution, but it did not help.

 

What might have gotten wrong? What should I try to make debugger and watches work normally again?

0 Kudos
1 Solution
jirina
New Contributor I
1,121 Views

I found the cause of the problem and I need to apologize here.

When working with configurations, creating a traceback one, the debug configuration's optimization option was changed from /Od to /O3. I am not aware of having done this change, anyway, this then caused everything I described in my previous posts. (blush)

Debugger and Watches work well now, with /Od being the optimization option.

 

View solution in original post

0 Kudos
3 Replies
Steve_Lionel
Honored Contributor III
1,147 Views

Use the syntax modulename::variablename.

0 Kudos
jirina
New Contributor I
1,141 Views

I am using this syntax, yet the value is not shown.

 

In case of arrays, I am trying to add a specific array element, e.g. array(i,j,k), to Watches, but array is reported as undefined variable. In this particular example, I am passing the (allocatable) array to a subroutine where I placed a breakpoint to check array values.

 

This worked well in previous versions of oneAPI, integrated to VS 2019, but I do not want to get back to older versions as the latest one contains certain bugfixes which got me rid of an ICE (Internal Compiler Error).

0 Kudos
jirina
New Contributor I
1,122 Views

I found the cause of the problem and I need to apologize here.

When working with configurations, creating a traceback one, the debug configuration's optimization option was changed from /Od to /O3. I am not aware of having done this change, anyway, this then caused everything I described in my previous posts. (blush)

Debugger and Watches work well now, with /Od being the optimization option.

 

0 Kudos
Reply