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

Setting Watch on user defined types hangs Visual Studio

dannycat
New Contributor I
834 Views

In Visual Studio2008 Ioften right click a variable in order to set a watch on it in debug mode and this is fine for variables defined using standard data types but when I try it with a user defined data type variablesVS2008 hangs and I have to kill the process, reopen VS2008 and start all over. I am surprised that no one else has experienced this but I want to highlight it now so that it can be resolved for future udpates (probably by VS2010 integration).

I have encountered this problem consistently on different computers with different operation systems (XP, Vista XPx64)so I suspect it is an issue with IVF integration into Visual Studio.

Are you aware of this problem and if so is there a work round, apart from not using this method?

0 Kudos
5 Replies
Steven_L_Intel1
Employee
834 Views
I have not seen this problem reported before, and have not experienced it myself. I just tried again to be sure.

Just so I understand, exactly what do you do to "set a watch"? Right click on the variable and select Add Watch?
0 Kudos
dannycat
New Contributor I
834 Views
Hi Steve,

I will elaborate further as I didn't explain fully what happens.

When I have a user defined type that has been given the allocatable attibute and this has been allocated.

eg

type TBUF
integer :: ival
real :: rval
end type
type(TBUF),allocatable :: buf(:)
integer :: i

allocate(buf(100))

do i = 1 , 100
buf(i)%rval = float(i)
buf(i)%ival = i
enddo

In the example above Ihave an allocated the user defined type. buf.If I set a breakpoint inside the loop and try to set awatch of the whole buf array I right click "buf" "Add Watch", this is fine, but if I want to watch the individual array component buf(i) (by highlighting buf(i)and then right clicking) VS2008 freezes before the Options list is displayed. This does not happen for normal arrays defined using standard data types.

I hope this explains it better.
0 Kudos
nvaneck
New Contributor I
834 Views
I've seen this problem, or a similar one, in VS 2005 and Intel Fortran 10.1. When I right-click on aderived type structure I can look atit dynamically, but as soon as I try to use quick watch oradd watch, VS crashes. I've learned to be careful and only try to add such watches when I absoulutely need to and hope it works. It does not happen with all derived types, and perhaps not always. I don't know if it's only with allocated derived types or not. My hope was that it was fixed or went awayin later releases so when I eventualy upgrade it will be gone.
0 Kudos
Steven_L_Intel1
Employee
834 Views
Ok - I can reproduce a problem with that scenario. I'll report it to the developers. What happens for me is that VS crashes as soon as I right-click.

Thanks for the added details.

A workaround is in the Watch window, simply type buf(i) and press Enter. That will add the watch for you.

Escalated as issue DPD200154339.
0 Kudos
Steven_L_Intel1
Employee
834 Views
This was fixed in version 12 (Composer XE 2011), and also in update 7 to 11.1.
0 Kudos
Reply