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

Can't step through main in fortran

Alan_L_1
Beginner
1,572 Views
I have a solution with a fortran project that compiles to an executable and c project that compiles to a static library. I am trying to debug and I am unable to step through the main portion of my fortran code. Any ideas?
0 Kudos
5 Replies
Steven_L_Intel1
Employee
1,572 Views
Did you set a breakpoint at the first executable statememt in the program. You need to do that - you can't just "step in" to the program.
0 Kudos
Alan_L_1
Beginner
1,572 Views
I am not positive that I know what you mean by "first executable statement." I have set a break point at the first call to a subroutine in the main section of the fortran code.
0 Kudos
Steven_L_Intel1
Employee
1,572 Views
Ok, that's fine - as long as you set a breakpoint somewhere that will be executed. You then click the Go button (or press F5) to start execution, and it should stop when the breakpoint is hit. What goes wrong when you try it?
0 Kudos
Alan_L_1
Beginner
1,572 Views
When I go to run it is like the break point in the main fortran code gets disabled. If I put a breakpoint inside the first subroutine that is called then the debugger will stop at that breakpoint. Here is what the call stack looks like at this point:

mf2kd.exe!PLL1IN() Line 11 Fortran
mf2kd.exe!MAIN$MF2K$BLK() + 0x2f bytes Fortran
mf2kd.exe!_main() + 0x65 bytes
mf2kd.exe!__tmainCRTStartup() Line 327 + 0x19 bytes C
mf2kd.exe!mainCRTStartup() Line 196 C


When I try to go up one level to MAIN$MF2K$BLK() it will tell me that there is no source code available for that location.
0 Kudos
jimdempseyatthecove
Honored Contributor III
1,572 Views

It looks like you are linking in the Release version of the Fortranmain (Program) stub of your application. Either that or the path to the Fortranmain (Program) is not found.

Also, in the properties for the application (execuitable project) check the configuration manager to see if the expected configuration for the main (Program) is being linked in. Sometimes when I upgrade IVF release versions the configurations in my solutions/projects don't always update properly and I must reselect the proper configurations.

And check in your debug configuration to see if the main (Program) includes full debug information.

Jim Dempsey

0 Kudos
Reply