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

Intel oneAPI and Visual Studio 2022 PDB Misalignment

Zernow__Richard
New Contributor I
161 Views

I have a mixed language 64-bit application running in a VirtualBox Windows 10 environment.  The front end is written in C# and .NET 8 using Visual Studio 2022 Version 17.9.2.  The technical application is  written in Fortran using oneAPI Fortran 2024.1 and built as a DLL.  I am running in DEBUG x64 mode.

I am trying to debug the code interface between the two applications.  I placed a breakpoint in the C# application at the call to the DLL.  I press F11 to step into the DLL and after several moments (delay assumed to be attributed to the VM environment) the cursor appears on the first line of the DLL but ONLY if I place a breakpoint there.

As I press F10 the cursor moves forward but to non-executable source code lines (comments or blank lines as an example).  I can press F10 again and again it moves forward to a non-executable line.

I checked if my VS and oneAPI were on the compatibility list from Intel (Maybe I need to be using 2022 version of oneAPI).  I have made sure all past versions of the PDB , LIB, EXP, and DLL files were deleted prior to rebuilding the solution.  I've tried making sure the location of the PDB file is specified explicitly and I've tried defaulting the location.  I've built my DLL using IFORT and IFX.

The C# application was written by another developer in my group and consists of several test applications to test connectivity between his C# and my Fortran.  He has a script (Test Explorer) that appears to copy my DLL and PDB from where I generate the output files (DLL and PDB) to the directories associated with each of his test applications.

I am at a complete loss.  I've been all over the internet looking for someone else that might have experienced the same thing but without success.

Any and all help would be appreciated.  (I cannot upload the code here as it is proprietary and I don't know if I could generate a comparable code that demonstrates the same problem.)

Thankyou in advance.

Labels (3)
0 Kudos
1 Reply
Zernow__Richard
New Contributor I
26 Views

Problem Solved!

I've been developing the technical (Fortran) code since 1986.  Just prior to this problem I was using Intel Visual Fortran Pro in combination with Visual Studio 2019.  One requirement is that the code must be directly compatible with Linux without any need to modify or otherwise touch the source code to allow building in Linux.

To this end, as the Windows version of my code includes including certain Windows specific libraries and APIs that were not needed in Linux, I added numerous pre-compile commands throughout the code to bypass the Windows specific blocks of code when being built on a Linux platform.  These pre-compiler commands have worked flawlessly for 20+ years, that is until I started using oneAPI Fortran.

While it appears that the pre-compile commands are working on my Windows platform, their presence is causing a misalignment of the symbols file (PDB) between the debugger and source code.  Shortly after a single step, and the debugger passes over a pre-compiler command, the cursor starts pointing to the wrong line.  Sometimes it will point to a comment, sometimes a blank line, etc.  And if I manually set a breakpoint on a line at runtime the breakpoint will appear on a different line entirely.

When I comment out all the pre-compiler commands in the first subroutine where the errors are first observed, the debugger and breakpoints all start behaving exactly as they should.

There may be some new settings in the Fortran properties window that I have yet to discover, but for now I can proceed with my work.  I'll deal with the pre-compile commands at a later date.

I hop this will be helpful to someone else that may be experiencing a similar frustration.

0 Kudos
Reply