Naive PGI Visual Fortran question

My Fortran application is a DLL called from a C++ main GUI application. I have compiled it successfully using PGI Visual Fortran in Visual Studio 2008, and it runs, but the debugger doesn’t work as I expected.

For example, if I set a breakpoint within a Fortran routine that I know is regularly called from the GUI, the breakpoint is never triggered; likewise, if I set a breakpoint in the C++ code just before a call to a Fortran function and try to step through, the debugger ignores the Fortran code and steps on to the next C++ line.

I am of course compiling the Fortran code in debug mode. What am I doing wrong?

The VC++ debugger may be having trouble debugging in the PGI-compiled code. The PGI debug engine is included with PVF and can debug both VC+±compiled and PGI-compiled objects. You can invoke the PGI debug engine by following these steps:

  1. Set the PVF project as the StartUp Project (right-click on the project in the Solution Explorer to get this option in the context menu).
  2. Open the properties for the PVF project and select the Debugging property page.
  3. Set Application Command to the full path to the exe to run (i.e., in your main project).
  4. Set Application Arguments, Environment, and Working Directory if necessary.
  5. Try running without debugging first.
  6. Try debugging (F5 as usual). This should invoke the PGI debug engine. For the most part the debugging experience should look the same as when you use VC++, but the PGI-compiled code should also be accessible.

Thank you very much. I tried that, and it worked when I selected “Start without debugging”.

However,when I selected “Start debugging” using the same settings, all that happened was that after a very long (5-10 minute) delay, a blue box (entitled “PGDGB Program I/O Window”) appeared on the screen with a message saying:

“- accept: timed out: client init: No such file or directory”

I must have missed something out somewhere, but the fact that it worked well the first time round indicates that I should have the paths set up properly. Where else should I look?

I’ve run into same problem with PGI VF 12.10

Investigating have been shown that seem debugger cant work when C++ program is caller. Their sample works only with “Compile as C” It’s not matter of name r calling conventions, as I made functional samples (which work withoud debugging) but debuggers hangs like in your case.

PGI should openly point fact that their tool doesn’t work as it stated “Interlanguage debugging of PGI fortran and C++” is actually “Interlanguage debugging of PGI fortran and C”. Visual Studio uses different, very ancient compiler for “Compiling as C”, that’s probably why there is difference.