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

Debugger: allocatable within block construct

andrew_4619
Honored Contributor III
714 Views

I have an allocatable integer array declared and allocated within a block construct. Whilst the code works OK the debugger says it is an undefined variable and will thus not evaluate it. Is this a known problem? Visual Fortran Compiler 19.0.4.245/  Microsoft Visual Studio Community 2017 
Version 15.9.15

0 Kudos
5 Replies
FortranFan
Honored Contributor III
714 Views

Welcome to the club!!

I've been long disappointed to find this issue persist in the integration with Visual Studio.

0 Kudos
andrew_4619
Honored Contributor III
714 Views

Thanks FF. On reflection I think I have seen this before.  Is there a bug report filed? As we all know bugs have zero visability these days.

0 Kudos
Johannes_Rieke
New Contributor III
714 Views

Hi I can confirm this uncomplete integration of VS debugger. I filed in the past many of these issues. But I gave up... With every new VS version new things come up or old issues are back. If you will be brave and have the time, you should file this bug.

As FF suggested in another thread, Intel would make many friends, if they will support VS code integration officially.

0 Kudos
Devorah_H_Intel
Moderator
714 Views

Thank you for your report. This case is escalated to engineering for a fix.

0 Kudos
jimdempseyatthecove
Honored Contributor III
714 Views

What you might try to do to aid in debugging is either

a) In the block, after allocation, add ASSOCIATE(dYourArray => YourArray), then examine the data using dYourArray
or
b) in the outer scope add as an example: REAL, POINTER :: dYourArray(:)
    and in the local block add TARGET attribute to YourArray. and after allocation add dYourArray => YourArray

One of the two methods should get you by until bug is fixed.

Jim Dempsey

0 Kudos
Reply