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

Visual studio watch does not show module variables using ifort classic

ata_mesgarnejad
2,533 Views

Hi,

 

I'm unable to debug/watch a variable defined in the module. In the watch window they are being shown as undefined and I get a similar error if I try to add them to a breakpoint condition. I have attached the minimal example replicating this issue. 

mesgarnejad__ata_3-1693245511799.png

 

I'm using 

visual studio 2022 (17.6.5) and intel Fortran Compiler Classic 2021.10.0

mesgarnejad__ata_0-1693245000814.png

mesgarnejad__ata_1-1693245059797.png

 

PS: The watch works correctly for ifx.

 

Labels (1)
1 Solution
Steve_Lionel
Honored Contributor III
2,507 Views

I find it interesting that ifx does this on its own. With ifort, you needed to use modname::varname in the watch window for module variables.

 

Steve_Lionel_0-1693248750377.png

 

View solution in original post

10 Replies
Steve_Lionel
Honored Contributor III
2,508 Views

I find it interesting that ifx does this on its own. With ifort, you needed to use modname::varname in the watch window for module variables.

 

Steve_Lionel_0-1693248750377.png

 

ata_mesgarnejad
2,485 Views

Thanks, Steve. That works.

0 Kudos
ata_mesgarnejad
2,483 Views

I want to add that hover over module variables still doesn't work! It would be nice if you could restore that behavior back as well.

0 Kudos
Godmaire
Beginner
2,298 Views

Dear Steve, 

Unfortunately, this solution does not work for me. Due some restrictions, I have to use Fortran 77 without extension. 
Wrapping the variable is not an option in my situation.

I need to be able to watch a variable while debugging. 


Presently, if I add a variable in the watch list, Visual Studio display a pop-up window about trying to display the value. Visual Studio hangs there... then crashes.

I did not have this problem with Fortran 2019 and Visual Studio 2017.

Any other suggestions to solve this issue?


Regards, 

0 Kudos
ata_mesgarnejad
2,290 Views

Hi, 

 

I have been having the same issue with variables watch hanging since updating to Visual Studio 17.7 from 17.6. I'm going to downgrade for now until this issue is fixed.

 

Best,

Ata

 

ata_mesgarnejad_0-1695313351793.png

ata_mesgarnejad_1-1695313381313.png

 

0 Kudos
JohnNichols
Valued Contributor III
2,269 Views

A recent topic discusses the new VSIX file to update the latest VS programs.  If you search you shall find it.  

Apply the VSIX and Bob's your uncle. 

0 Kudos
jimdempseyatthecove
Honored Contributor III
2,234 Views

jimdempseyatthecove_0-1695384611337.png

Does it hang when you use the correct variable name?

Jim Dempsey

0 Kudos
ata_mesgarnejad
2,213 Views

It did hang for me Jim whether I used the variable name or module_name::var_name. I have a screen shot of a super minimal example above.

0 Kudos
ata_mesgarnejad
2,258 Views

Thanks, John. I believe this is it. 

0 Kudos
JohnNichols
Valued Contributor III
2,203 Views

Yes, I believe that is correct.  

One learns many valuable lessons in life, that was not one of them, but perhaps. 

 REAL SK(12000)

 INTEGER MAXL,I,IA,N,NTA,ntb, FLAG
 Logical  ::   ex
 
    integer IRC 
    


 real(kind=4), allocatable :: R1(:)
 real(kind=4), allocatable :: R2(:)
 real(kind=4), allocatable :: Q1(:)
 real(kind=4), allocatable :: Q2(:)

 COMMON /CONTR/ IBUST,ICLOSE,NCYC,INEL,JNEL,NLC,XFAC,NELS,NEQ,NJTS,NSJTS,DMAX,NTERM,FAX,NLCS,MBAND
 COMMON /JOINT/ X,Y,RRTOT
 COMMON /SECTAB/ YMP,YMN,ROTCP,ROTCN
 COMMON /EQNS/ PP,RR,NA,R
 COMMON /STFTAB/ AA,E,XI,SKII,SKJJ,SKIJ,NSFSCI,NSFSCJ
 COMMON /SUPJT/ SPA,SPB,SPR,COSS,SINS,NSPJ,SPFRA,SPFRB,SPFRR
 COMMON /STIFF/ EK,EKA,FK,FKA,AKA,LM,A,AB
 COMMON /MEMBER/ IHI,IHJ,NODI,NODJ,NSFTP,NSECI,NSECJ,STOT,VPTOT,VPTP,VPTN,S,VP
 !
 COMMON SK

 NTA = 1

 allocate (R1(nTA))
 allocate (R2(nTA))
 allocate (Q1(nTA))
 allocate (Q2(nTA))


 I=1

 do IA = 1,NTA

     MAXL=6000                   ! Maximum Elements
     maxl = size(sk)

 

I first started using ULARC in 1981.  I compiled on a CDC machine at the time from a tape recording from UCB.   My boss did a masters at UCB.  

 

In all that time and with a lot of analysis I had never had a stop error on maxl exceeded by the model.   I had to add line 39 and increase sk. 

 

It just happened.  

It took a few minutes in the VS 2022 preview using the new VSIX stuff to work out the problem was the biggest I have run - ever.  

It is only 125 members. 

They were limited in the olden days.  

 

0 Kudos
Reply