Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Beginner
19 Views

Incorrect debugger view of user types in VS2012/Fortran 14

I am trying to understand whether the behavior I'm observing in the MS Visual Studio Professional 2012 (version 11.0.51106.01 Update 1), using Intel Visual Fortran Composer XE 2013 SP1 Update 1 (14.0.0074.11) is indicative of some coding mistake on my part, or simply a defect in the debugger.

I tried to create a small test program to demonstrate what I'm seeing.  In the program "dotest", subroutine "setup" calls "newitem" to create two instances of the user type a_itemdata and assign some values to some arrays belonging to these types.  In the debugger, at the bottom of "setup", I can view the contents and type of a user type:

-  itemlist(itemindex1) {...} TYPE(A_ITEMDATA)
+  itemlist(itemindex1)%P {...} REAL(8)
+  itemlist(itemindex1)%T {...} INTEGER(4)
+  itemlist(itemindex1)%TN {...} REAL(8)
+  itemlist(itemindex1)%V {...} INTEGER(4)
+  itemlist(itemindex1)%F {...} INTEGER(4)
+  itemlist(itemindex1)%H {...} INTEGER(4)
  itemlist(itemindex1)%NUMP 5 INTEGER(4)
  itemlist(itemindex1)%NUMT 4 INTEGER(4)
  itemlist(itemindex1)%EL  Undefined pointer/array REAL(8)
+  itemlist(itemindex1)%EU {...} REAL(8)

The type of the item is A_ITEMDATA, and all allocatable arrays can be expanded except EL, which is not yet allocated.  Then, if I stop inside the "lookat" subroutine, the user type appears to be corrupt in the debugger:

-  item1 {...} TYPE(A_ITEMDATA)
+  item1%P {...} REAL(8)
  item1%T  Undefined address 
  item1%TN  Undefined address 
  item1%V  Undefined address 
  item1%F  Undefined address 
  item1%H  Undefined address 
  item1%NUMP 5 INTEGER(4)
  item1%NUMT 4 INTEGER(4)
+  item1%EL {...} REAL(8)
  item1%EU  Undefined address 

Many, but not all the allocatable arrays now have undefined addresses, but the NUMP and NUMT values are correct.  The type of item1 matches the type of itemlist(itemindex1) viewed inside "setup".  Also, the values written to the console in "lookat" are OK, even though in the debugger, the array item1%T has an undefined address.

Am I making a mistake in my code, or is this a known problem in the debugger?

Thanks!

 

 


 

0 Kudos
4 Replies
Highlighted
Beginner
19 Views

By the way, I am seeing correct debugger behavior in

MS Visual Studio 2005 (8.0.50727.867) with Intel Visual Fortran (w_cprof_p_11.1.060)

and

MS Visual Studio Professional 2015 (Version 14.0.25422.01 Update 3) with Intel Parallel Studio XE 2016 Update 3 Composer Edition for Fortran Windows (w_comp_lib_2016.3.207).

However, for the project I'm working on I have to use the versions described in the original post.

0 Kudos
Highlighted
19 Views

I don't see what we can do for you here. You're using a very old and unsupported version and it seems likely that bugs have been fixed in the intervening years.

0 Kudos
Highlighted
Beginner
19 Views

Believe it or not, we upgraded from VS2005/IVF 11 a few months ago!  Ugh.

0 Kudos
Highlighted
19 Views

I misunderstood - thought you were seeing the bad behavior in 11.1. But my point remains that there's not likely any solution other than using a later version without the bug.

0 Kudos