I did post this some time ago on the Intel Visual Fortran forum, but I go no answer so far. I hope I will have more success on this forum.
Since months debugging has been a hell because of a bug in the Intel Compiler and/or debugger integration: basically most (but not all) arrays are displayed with the length 0 in the debugger, and their content cannot be shown. The bug happens with allocatable arrays, pointers or static arrays. Of course it makes debugging pretty impossible, and I have to use WRITE statements... For instance the debugger shows me this:
whereas the array ARR has the size 2!
I finally succeeded to reproduce the bug with a simple program:
PROGRAM Console USE m1 IMPLICIT NONE TYPE(TypeBase) :: ObjectBase TYPE(TypeExt) :: ObjectExt WRITE(*,*) 'Set a breakpoint here => debugger shows ObjectBase%Arr with length 0!!!' END PROGRAM
and the module M1 is:
MODULE M1 IMPLICIT NONE PRIVATE TYPE, PUBLIC :: TypeBase REAL :: Arr(2) = 0.0 CONTAINS PROCEDURE :: AFunction END TYPE TYPE, PUBLIC, EXTENDS(TypeBase) :: TypeExt END TYPE CONTAINS FUNCTION AFunction(this) RESULT(Res) CLASS(TypeBase), INTENT(IN) :: this TYPE(TypeBase) :: Res END FUNCTION END MODULE
As you can see it needs a tricky combination:
So it seems that using a combination of type-bound functions and type extension prevents the debugger (or the Fortran expression evaluator FEE) to show the length and content of arrays contained in derived types. I tried to play with debugger options in Visual Studio, and also with compiler settings, without success.
I am using Visual Studio 2015. I had the problem with the VS 2015 Update 2, and now Update 3, and with both Intel Visual Fortran 2016 and 2017.
at first glance it looked like you're right here since you use the debugger. So I checked with our FEE engineers and they confirmed the issue. However, it's compiler related since the debug information seems to be faulty in that exact case.
As a result I've filed an internal ticket (DPD200588188) to improve the debug information generation of the Intel Fortran Compiler. As soon as this is fixed, I'll let you know.