Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
Announcements
FPGA community forums and blogs on community.intel.com are migrating to the new Altera Community and are read-only. For urgent support needs during this transition, please visit the FPGA Design Resources page or contact an Altera Authorized Distributor.
29297 Discussions

Need help to debug Fortran *.DLL source

Gary_E_
Beginner
1,490 Views

The current project I'm working on consists of a main Fortran project (call it ProjA) that when compiles generates a *.DLL that is called from a main C++ project (call it ProjD) *.EXE.

This Fortran project (call it ProjA) depends on the linking to two static *.LIB files, one of which is compiled in Fortran (call it ProjB) and the other which is compiled in C++ (call it ProjC). The two *.LIB files are included directly in main Fortran project.

The entire path to ProjD *.EXE and the *.EXE name are both provided in the ProjA solution (Configuration Properties -> Debugging -> Command).

When I go to Debug ProjA, breakpoints I've set in ProjA (which is set at the first assignment operator; VAR1=0 !nitialization) are unable to be reached (red dot icon turns transparent and there's a triangular '!' sign at the corner) and the execution of the program reaches a point in ProjA where an error flag is set (one that I coded in ProjA) and an error message window pops up (one that I coded in ProjA) and the program stops execution as intended.

I am unable to understand why I cannot go into the source within ProjA to see what is going on. No matter where I put the breakpoints none of them work. This is very frustrating. It is obvious that the source in ProjA is executing, otherwise the error message window in ProjA would not pop up. I need to be able to see why this error message is being generated with the input being passed to it from the C++ *.EXE and to do that I need to be able to walk through the source.

Does anyone have any suggestions or ideas as to what is wrong?

0 Kudos
10 Replies
Gary_E_
Beginner
1,490 Views

I know this is probably a simple solution. I'm getting the error: "The breakpoint will not currently be hit. No symbols have been loaded for this document". Is there some sort of file I need to create for the debug to work properly??

0 Kudos
bmchenry
New Contributor II
1,490 Views

check your compile type: Build menu are you building as debug? and generating a symbols table?

0 Kudos
Gary_E_
Beginner
1,490 Views

I am definitely building in Debug mode. Where do I check to see if I'm generating a symbols table?

0 Kudos
Gary_E_
Beginner
1,490 Views

Under Configuration Properties -> Fortran -> Debugging:

(1) Debug Information Format is set to 'Full (/debug:full)'

(2) Enable Parallel Debug Checks is set to 'No'

Under Configuration Properties -> Linker -> Debugging:

(1) Generate Debug Info is set to 'Yes (/DEBUG)

(2) a *.pdb file is being generated

(3) Generate Map File is set to 'No'

(4) Map Exports is set to 'No'

Do I need to generate a map file for this sort of debug to work properly??

0 Kudos
Gary_E_
Beginner
1,490 Views

TOPIC SOLVED

UPDATE: I can now Debug ProjA. I set the Linker properties to (1) generate a map file (2) set the mapping of exports to 'Yes'. Now I can debug properly with the C++ *.EXE which calls ProjA *.DLL.

0 Kudos
bmchenry
New Contributor II
1,490 Views

From the FWIW department one tip which you may not know which will help you avoid having to copy files hither and yonder when recompiling and debugging...for a given solution with several projects, set the 'Output Dorectory' to

$(SolutionDir)$(ConfigurationName) for each of the projects

FWIW

0 Kudos
Gary_E_
Beginner
1,490 Views

UPDATE: After making some minor modifications to the source within ProjA I am back to where I started this morning, with the "The breakpoint will not currently be hit. No symbols have been loaded for this document" for all the breakpoints...

What is going on? Can anyone please guide me as to what will permenantly allow me to debug this project? The fact that I toggled some options on and it worked then now it doesn't work again with the same options enabled is distressing...

0 Kudos
Steven_L_Intel1
Employee
1,490 Views

A common cause of this problem is that the DLL being loaded is not the one that you built for debugging.

0 Kudos
Gary_E_
Beginner
1,490 Views

TOPIC RESOLVED

Update: OK, I got the debug session working again. I needed to copy over the modified (rebuilt) *.LIB, *.DLL and mapfile files over to the ProjD ...\Debug folder.

0 Kudos
bmchenry
New Contributor II
1,490 Views

not sure why my prior comment didn't get posted? i offered advice to have ALL build files sent to one directory so you don't need to copy things. use $(SolutionDir)$(ConfigurationName) for your output directory for each of the projects in your solution.

Then all the dlls for a given $(ConfigurationName) are stored in the same directory. Copying of dlls not required! now if this posts up double, guess i get double points! :-)

0 Kudos
Reply