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

VS debugger to use prior version source files?

New Contributor II

Windows 11, 64-bit, Visual Studio 2022 (17.4.5), C++ and Intel Fortran

I keep my project's source files and executables in a set of directories ("WORKING"). When I release an update of my app, I save the executable, .pdb and all source files in a separate set of directories ("PRIOR").

When I want to debug a prior version of the app, I locate the .exe of the prior app, double-click in File Explorer, open VS2022, and attach to the app's process. Then I open a source file in the PRIOR tree ("SOURCE") and set a breakpoint. When the app reaches the breakpoint, it loads the source file with the same name (i e, SOURCE) from WORKING, not PRIOR. Since these two source files are usually different, this makes it very difficult to debug, since I am seeing incorrect source lines as I step thru the pgm.

Opening the VS debug window Modules shows that my process is using the .pdb from PRIOR, as it should be, but the source files are coming from WORKING. explains how to set the source file locations, and it works for C++ source files, but not for Fortran .f90 source files. For Fortran sources, even if the PRIOR version of the .f90 source file is loaded into VS debugger, any action, such as setting a breakpoint, loads the sam-named source file from WORKING.

How can I make VS debugger use the correct Fortran source files from WORKING?

0 Kudos
0 Replies