Cannot debug into Fortran DLL using VS2010

Cannot debug into Fortran DLL using VS2010

I have a C# project that uses DLLs that are coded in Fortran wrapped in C++. I have been sucessfully using these project in VS2005, but I needed to upgrade the C# to VS2010. After doing this upgrade, I can no longer debug into the Fortran part of the DLL (I can still debug into the C++ that wraps it). At the point where I step into the Fortran, a tab for the Fortran code opens up, with the name of the file on the tab, the cursor turns to an hourglass for about 5 secs, then VS2010 becomes unresponsive. No code ever shows up in the tab (the tab interior is a solid blue). At this point I have to shut down VS2010.

I get no error messages. I have tried recompiling the DLL using VS2010, with the same result. I am using IVF 2011.10.325 in the VS2010. Any suggestions?

8 posts / 0 new
Last post
For more complete information about compiler optimizations, see our Optimization Notice.

In the C# project, select Properties > Debug. Check the box "Enable unmanaged code debugging" and click OK.

Retired 12/31/2016

Unmanaged code debugging was set. That is why I am able to debug into the C++ wrapper of the DLL.

I haven't heard these symptoms reported before. Any possibility you can install a newer version of Intel Fortran to get the newer debug support? Can you put together a test case that demonstrates the problem that we can look at?

Retired 12/31/2016

I have updated to the latest IVF and rebuilt the DLL projects from source, with no change. I will no try to create a simple test project.

Thanks for the help. I have solved the problem. The issue seems to be in the calling conventions. The DLL in question was using CVF in the Fortran project, and the C++ was specifing that the Fortran would be called using __stdcall. I guess this works OK in VS2005. I reset the Fortran project to default and in the C++ declared it as __cdecl. I don't know if this is the best combination, but it seems to work in VS2010.

I guess I need to do some research on the subject.

Strange - I have not seen any differences between VS versions in that regard. I'm glad you got it working and generally recommend avoiding /iface:cvf unless you have no alternative.

Retired 12/31/2016

I have seen several other issues wtih respect to the VS upgrade where code just broke. I wont go into them because they are not Fortran related. I can say that for a few days I thought I may have seriously broke the application. With this last debugging problem resolved, I am back on track.

Leave a Comment

Please sign in to add a comment. Not a member? Join today