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

Viewing pointer-based array within VS.NET IDE

eezvmt
Beginner
792 Views
We have a serious problem on being able to view contents of the pointer-based arrays using VS.NET 2003 debugger and Visual Fortran v8.1. This was possible within VS6 IDE with both Compaq Visual Fortran 6.6 and Intel Fotran v7.1.

Also, invoking "View Array" on a pointer-based array in the debug session crashes VS.NET 2003 completely!

Here is the simple file to demonstrate what I am talking about. Create a solution in VS.NET 2003 and step through the debugger. Apply "Quick Watch" to ARRAY and you will not see its members. Apply "View Array" on it, and it will crash the IDE. Try "Quick Watch" within Visual Studio 6 IDE (with either CVF6 or IVF7) and it will show contents of the ARRAY variable in the LOOP procedure.


PROGRAM TEST

C Testing Intel compilers for debugging pointer-based arrays

CALL ALLOC
CALL LOOP

END

C This subroutine allocates memory for a pointer-based array
SUBROUTINE ALLOC

C This section would normally be in an include file, but is pasted her for convenience
INTEGER NMAX
INTEGER ARRAY(NMAX) ! dynamic array
POINTER (PARRAY,ARRAY)
COMMON /I_ARRAY/ NMAX, PARRAY
C End of sections from an include file

C Dynamically allocate memory
NMAX = 10
PARRAY=MALLOC(NMAX*4)

END


C This subroutine manipulate elements in the pointer-based array
SUBROUTINE LOOP

C This section would normally be in an include file, but is pasted her for convenience
INTEGER NMAX
INTEGER ARRAY(NMAX) ! dynamic array
POINTER (PARRAY,ARRAY)
COMMON /I_ARRAY/ NMAX, PARRAY
C End of sections from an include file

INTEGER N ! number of elements

C Elements of ARRAY should be visible in a debugger, for example using Quick Watch
C They are visible in Visual Studio 6 IDE (with Intel Fortran 7)
C They are NOT visible in Visual Studio .NET 2003 IDE (with Intel Fortran 8)
C Furthermore, "View Array" command on .NET 2003 IDE completely crashes the IDE!
DO N=1,NMAX
ARRAY(N)=N*N
ENDDO

DO N=1,NMAX
WRITE(6,*) ARRAY(N)
ENDDO

END
0 Kudos
3 Replies
Intel_C_Intel
Employee
792 Views
This must be the week for "View Array" issues. See http://softwareforums.intel.com/ids/board/message?board.id=5&message.id=12937for a discussion on using "View Array" with array components of a derived type.
We'll work on enhancing the "View Array" functionality to support additional types (or at least fix it so it doesn't crash the IDE when pointer-based arrays are viewed!). Please contact Intel Premier Support if you'd like to track this issue.
Ican't answer the "Quick Watch" part of your question. Maybe Steve will have something to say on this...
John
0 Kudos
Steven_L_Intel1
Employee
792 Views
I encourage anyone encountering problems with debugging to report them to Intel Premier Support.
0 Kudos
eezvmt
Beginner
792 Views
Thanks chaps,

I've submitted this issue to Premier and they managed to reproduce the problem of not being able to view pointer-based arrays in the debuger. Hopefully the fix will come soon, as the whole our code is based on dynamically allocated pointer-based arrays and it is a real pain having to switch to Compaq VF every time we need to inspect arrays.

As for the "View Array" bug, they did not manage to reproduce crash.

Cheers

Vlada
0 Kudos
Reply