When debugging a FORTRAN program step by step, if the debugger gets into the execution of a statement expanding more than one line, the "step" command is stuck between the lines of the multi-line statement about ~18 cycles before it exits and continues to the next statement. For instance assume the following FORTRAN code that expands into two lines:
Line 1: ep_data(order(i))%EE = (ep_data(order(i))%landings + m_consumed(order(i))) &
Line 2: / (ep_data(order(i))%PoB * ep_data(order(i))%biomass)
Line 3: group_no = count(detritus_group_no(:) < order(i)) + 1
When the debugger gets into the execution of the first line (Line 1) of the statement, you can "step" to the next part of the statement on the second line (Line 2). Once you are on the second line, if you issue "step" one more time, the debugger prompt goes back to the previous line (Line 1). The debugger is held stuck between these two lines for about ~18 cycles until it breaks the cycle and proceeds to the following statement on Line 3.
I would be glad if you have an idea about this strange problem and could share the solution with me.
I forgot to mention that I am using "Intel Debugger for applications running on Intel 64 Version 13.0" with the GUI under Debian Linux x64 with Java version as follows:
java version "1.7.0_25"
OpenJDK Runtime Environment (IcedTea 2.3.10) (7u25-2.3.10-1~deb7u1)
OpenJDK 64-Bit Server VM (build 23.7-b01, mixed mode)
I do not mean loop or CPU cycles. What I meant was that the cursor of the debugger in the GUI (the blue highlighted line) goes back and forth between the two lines of the code (Line 1 and Line 2), which is split into two lines with an ampersand, at around 18 times until the debugger (hence the blue highlighting of the debugger) proceeds the execution of the next statement on Line 3. I hope I could make myself clear.
Thanks. Yes, although in the source code those 3 lines just follows each other, there are lots of things listed in the assembler as in the attached text file (an assembler excerpt from another part of the code but similar situation) between the execution of those three lines.
But I have no idea what all those are about. Do you have an idea?
Sorry for my long delay I must admit that I completely forgotten this thread.
I looked at your fortran code disassembly and it seems that 4x unrolling is in place with RIP related addressing.I did not find any branch instructions which could cause debugger perform some kind of backward loop.