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

Debugging arrays is still impossible with Visual Studio after over a decade of it being broken

Andrew_Smith
Valued Contributor I
1,295 Views

Arrays mostly show incorrect sizes. The most common error is showing an array size of 1:0. Here I just stepped over these assignments and tried to view the array:

Andrew_Smith_0-1706203288752.png

In another copy of VS I had running on a similar exe, I got:

Andrew_Smith_1-1706203402245.png

Both wrong since the array contactPoint_dif is declared as size 2. It's not an allocatable. You cant even attempt to access an element using the watch window as it falsely detects index out of range.

Are we expected to dot our code with print statements on the console to see the numbers ? That's what I have to do for hours. Intel's debugger is the main reason we are ditching Intel compilers.

This is all using latest Visual Studio and latest compiler and debugger on Windows.

Project configuration is Debug. No I cant provide the code and its unlikely I could provide made up code to replicate the issue. But that's no excuse. You must have some large projects of your own.

Here is the compile command line:
/nologo /debug:full /MP /Od /fpp /I"..\IMSL\emt64" /I"..\AdditionalLibs\Debug\x64" /I"D:\Dev\rxsstaticscalculator\MSXMLInterface\x64\Debug" /I"D:\Dev\rxsstaticscalculator\Utilities\x64\Debug" /I"D:\Dev\rxsstaticscalculator\DifferentialMaths\x64\Debug" /I"D:\Dev\rxsstaticscalculator\DataPackage\x64\Debug" /I"D:\Dev\rxsstaticscalculator\BearingData\x64\Debug" /I"D:\Dev\rxsstaticscalculator\MathsConstants\x64\Debug" /I"D:\Dev\rxsstaticscalculator\CustomStaticsCoupling\x64\Debug" /DINITNAN /DDEBUGV /Dx64 /DenhancedChecking /DenableIMSL /assume:recursion /Qopenmp /standard-semantics /warn:declarations /warn:unused /Qinit:snan /module:"x64\Debug\\" /object:"x64\Debug\\" /Fd"x64\Debug\vc170.pdb" /traceback /check:pointer /check:bounds /check:shape /check:uninit /check:format /check:output_conversion /check:stack /libs:dll /threads /dbglibs /Qmkl:parallel /c

0 Kudos
2 Replies
Steve_Lionel
Honored Contributor III
1,226 Views

I can't say I've ever run into this behavior, and I have debugged many large applications that use arrays.

0 Kudos
FortranFan
Honored Contributor III
1,211 Views

@Andrew_Smith wrote:

Arrays mostly show incorrect sizes. The most common error is showing an array size of 1:0. Here I just stepped over these assignments and tried to view the array:

Andrew_Smith_0-1706203288752.png

In another copy of VS I had running on a similar exe, I got:

Andrew_Smith_1-1706203402245.png

Both wrong since the array contactPoint_dif is declared as size 2. It's not an allocatable. You cant even attempt to access an element using the watch window as it falsely detects index out of range.

Are we expected to dot our code with print statements on the console to see the numbers ? That's what I have to do for hours. Intel's debugger is the main reason we are ditching Intel compilers.

This is all using latest Visual Studio and latest compiler and debugger on Windows.

Project configuration is Debug. No I cant provide the code and its unlikely I could provide made up code to replicate the issue. But that's no excuse. You must have some large projects of your own.

..


@Andrew_Smith ,

You are NOT alone in such travails.

But note the issue is not necessarily with debugging arrays per se in Visual Studio.  Rather, the problem has to do with *certain components* of derived types, whether they be arrays or of some other nature, especially when indirection of some particular sorts comes into play.

Intel team, since their oneAPI advancement and further maturation of their IFX compiler, has fixed quite a few issues on the debugger front as well, mega kudos to Intel team in this regard.

But some particular problems remain, some with ALLOCATABLE and POINTER and POLYMORPHIC components also though these may not be a factor for you.

Unfortunately with the teams I work, the troubles are noticed in proprietary code which the management refuse to approve for submission in Intel OSC support requests.  Creating reproducers of non-proprietary nature takes too much time, or is impossible.

Thus certain gaps continue to remain with Intel Fortran integration in Visual Studio.  If you can work around the replication hurdle somehow, that might help you.

0 Kudos
Reply