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

Cannot debug into Fortran DLL using VS2010

Stephen_Painchaud
445 Views

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?

0 Kudos
7 Replies
Steven_L_Intel1
Employee
445 Views

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

0 Kudos
Stephen_Painchaud
445 Views

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

0 Kudos
Steven_L_Intel1
Employee
444 Views

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?

0 Kudos
Stephen_Painchaud
444 Views

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.

0 Kudos
Stephen_Painchaud
444 Views

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.

0 Kudos
Steven_L_Intel1
Employee
445 Views

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.

0 Kudos
Stephen_Painchaud
445 Views

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.

0 Kudos
Reply