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

Wrong debug information in the watch windows

Daniel_Dopico
New Contributor I
1,459 Views

I am using Intel fortran 19.1.0055.15 on Visual Studio 2017 in windows 10 and I cannot see the right information in the watch window for this simple derived type.

 

PROGRAM MAIN
    IMPLICIT NONE
    TYPE state_vector
        REAL(8),ALLOCATABLE,DIMENSION(:)::y
    END TYPE state_vector

    TYPE STATES
        TYPE(state_vector)::q,qp
    END TYPE STATES

    TYPE(STATES)::coord

    ALLOCATE(coord%q%y(5))
    coord%q%y=1.d0
    ALLOCATE(coord%qp%y(3))
    coord%qp%y=0.d0
    
    PRINT *,coord%q%y
    PRINT *,coord%qp%y
END PROGRAM MAIN

 

When I run the code, the console offers the right result, which is:

1.00000000000000 1.00000000000000 1.00000000000000
1.00000000000000 1.00000000000000
0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000

Nevertheless, if I try to see these variables in the watch window, I get exactly the same dimensions for coord%q and coord%qp:

  Nombre Valor Tipo
coord {...} TYPE(STATES)
  ◢ coord%Q {...} TYPE(STATE_VECTOR)
  ◢ coord%Q%Y (1:5) REAL(8)
  coord%Q%Y(1) 1.00000000000000 REAL(8)
  coord%Q%Y(2) 1.00000000000000 REAL(8)
  coord%Q%Y(3) 1.00000000000000 REAL(8)
  coord%Q%Y(4) 1.00000000000000 REAL(8)
  coord%Q%Y(5) 1.00000000000000 REAL(8)
  ◢ coord%QP {...} TYPE(STATE_VECTOR)
  ◢ coord%QP%Y (1:5) REAL(8)
  coord%QP%Y(1) 1.00000000000000 REAL(8)
  coord%QP%Y(2) 1.00000000000000 REAL(8)
  coord%QP%Y(3) 1.00000000000000 REAL(8)
  coord%QP%Y(4) 1.00000000000000 REAL(8)
  coord%QP%Y(5) 1.00000000000000 REAL(8)

 

Any advice or idea on what's happening?

0 Kudos
5 Replies
FortranFan
Honored Contributor II
1,422 Views

See this thread: https://community.intel.com/t5/Intel-Fortran-Compiler/Nested-allocatable-type-with-allocatable-components/td-p/1163698

My hunch is what you're noticing is another aspect of a long-standing issue with Intel Parallel Studio and Fortran compiler integration with Visual Studio where working with ALLOCATABLE objects, particularly components of derived types and especially nested derived types, are not handled reliably in the debugger.

You may want to submit another support request to Intel Support, chances are starting with some recent reincarnation of Visual Studio 2019 and Intel software revamping, there will be some progress on this matter - your case will be good for Intel to include in their checking.

In the meantime, as shown in the link to the other thread, you can try the ASSOCIATE construct as a workaround to help with your debugging.

Daniel_Dopico
New Contributor I
1,395 Views

Thank you very much Fan, I'll have a look at that thread and workaround.

I have put a ticket yesterday and they aswered this (I paste it here because it has nothing confidential, I guess, I hope Barbara is not going to be mad at me), they added it to some other open bug:

Daniel_Dopico_0-1593762158632.png

The problem is that  I am stuck in version 2019 update 2 due to other bugs that I submitted before to Intel (not corrected until 2020 update 1).

It is quite annoying, it seems that not many people are working on the fortran compiler nowadays, I currently have 7 open bugs with them...

0 Kudos
Daniel_Dopico
New Contributor I
1,372 Views

Thank you Fortran Fan, at least the ASSOCIATE workaround works. It seems that the problem comes from way before than I thought, because I checked the Intel 2019 update 2 and already has the issue, so it does not solve my problem, I think you have to go until Intel 2018 to get the right debugger information.

 

0 Kudos
Daniel_Dopico
New Contributor I
1,163 Views

Apparently the issue has been fixed in the recently released Intel Fortran Compiler (the say). I didn't have time to check it though.

Let's hope this and other debugging issues are fixed.

0 Kudos
Daniel_Dopico
New Contributor I
1,115 Views

I can confirm that at least this issue was fixed in the mentioned release.

0 Kudos
Reply