Debugging Fortran DLL called by IDL

Debugging Fortran DLL called by IDL

Bild des Benutzers hgr_iwf

Hello,

I need help by debugging a Fortran DLL which is called by an IDL (Interactive Data Language) procedure.

In the "Command" field I insert the exe file of the IDL program (I do this because I cannot produce an exe file of my program in IDL). When I start the dll the IDL program starts and than I compile and start my developed program. But every breakpoint I set is ignored. What should I do to hit the breakpoints?

For information: when I raise an error in my program than I can choose a debugger and all the values of the parameters in the dll are shown correctly. But I had to raise an error.

I use a test license of the Intel Fortran Composer XE 2013 and the IDL 7.1.2.

Thanks,
Hannes

11 Beiträge / 0 neu
Letzter Beitrag
Nähere Informationen zur Compiler-Optimierung finden Sie in unserem Optimierungshinweis.
Bild des Benutzers Steve Lionel (Intel)

This problem is usually caused by the DLL being loaded by the external program being a different copy than the one you built and set the breakpoint in. You could also insert a call to DebugBreak (add USE KERNEL32 to make the definition available) and this will break into the debugger.

Steve
Bild des Benutzers David White

what I did to try to debug a DLL being called from Excel was to copy the debug version of the DLL from the project folder to the folder where Excel expected it.

this works, but, of course I have to repeat this step every time I rebuild the DLL.

David

Bild des Benutzers Steve Lionel (Intel)

Or what I do is give the path to the DLL I built in Excel. I have not had great success in copying the DLL when it comes to breakpoints.

Steve
Bild des Benutzers hgr_iwf

Thanks for your answers, but I could not debug my dll. When I use the function DebugBreak, I cannot select the debugger where the code of the dll is opened. But anyway the problem is also, when I arise an artificial error, I cannot debug the dll furhter because I got always the message that an error was occurred.
So, is there a possibility to debug my Fortran dll without producing an error?

Thanks, Hannes

Bild des Benutzers Steve Lionel (Intel)

What is the exact and complete text of the error message?

Steve
Bild des Benutzers hgr_iwf

I think there is a misunderstanding. Normally I get no error message when I run my program. I only want to debug my Fortran DLL which is called from IDL.

When I start the dll, the IDL program is called and than I compile and start my IDL program. Everything work, but when the dll reaches a breakpoint in the it does not stop.

Hannes

Bild des Benutzers David White

Are you starting the IDL program from within VS using Debug mode?

This is how I do it using Excel. In the DLL project, I make the Debug command to be Excel.exe. I set the breakpoint on the first line of the DLL code. When I start debugging, Excel starts, I open the workbook, and when it calls the DLL, it breaks in Visual Studio.

I would guess you could do something similar in IDL.

Regards,

David

Bild des Benutzers hgr_iwf

Yes, I am starting the IDL program via VS in the debug mode. I start my Fortran dll in VS (debug mode) and than the IDL workbench is called automatically. In IDL I have to start my program, which uses the Fortran dll. But all breackpoints which I insert in my dll code is ignored.

Thanks, Hannes

Bild des Benutzers David White

Hannes,

Back to Steve's first comment - are you sure you are using the same DLL? Do you happen to have several copies of the DLL on your machine? Is IDL using the Release version of the DLL instead of the Debug version?

Regards,

David

Bild des Benutzers hgr_iwf

I have several copies of my DLL but IDL uses the one in the VS project order (is the same which I want to debug) and it is the debug version.

Hannes

Melden Sie sich an, um einen Kommentar zu hinterlassen.