Silverfrost Forums

Welcome to our forums

Line number debug information lost when module is INCLUDEd

23 Oct 2020 6:18 (Edited: 23 Oct 2020 10:42) #26521

The source file mymod.f90 contains:

module my_mod
contains
real function divide(x,y)
implicit none
real, intent(in) :: x,y
divide = x/y
return
end function
end module

This module source is INCLUDEd and USEd in the following driver, tinc.f90

include 'mymod.f90'

program tst
use my_mod
implicit none
real :: x = 3.0, y = 2.0
!
print *,divide(x,y-2.0)
end program

If I compile and link tinc.f90 using /debug (or /check), with or without /64, when the program aborts because of floating divide by zero on line-6 of the module source, no line number information is shown for the module procedure (either in the error pop up when run from the command line, or inside SDBG/SDBG64). I have used Version 8.66 with the latest (Oct 2020) DLLs, but the same behaviour occurs with Version 7.20 as well.

If, however, the INCLUDE statement is removed and the two source files are compiled and linked with /debug, the line numbers for the module source file are correctly displayed.

This bug was first seen in a larger program in which the module contained several subroutines and functions.

23 Oct 2020 7:06 #26522

With bug reports of this nature, it will be helpful if the OP reports, in addition:

(i) whether a 32-bit or 64-bit executable, or both, exhibit(s) the described behaviour,

(ii) the compiler version used,

(iii) the compiler options used.

24 Oct 2020 12:43 #26523

Thanks, Eddie, I have added the missing version information to the original post. The other two pieces of information were already present.

I have now tested a few more older versions.

With 32 bit compilations, using /debug, I found that only the address was given for the location where the floating divide by zero occurred.

With 64 bit compilations, I noted the following variations:

 1. No line number or offset shown for module procedure; the number of the source line in the caller is reported - Version 8.50.0

 2. The offset in the module procedure, and the line number and offset for the caller, are shown - Version 8.51

 3. The line numbers and offsets in the module procedure as well as the caller are shown (the correct behaviour) - Version 8.40.1
24 Oct 2020 7:30 #26525

mecej4

Thank you for the feedback. I have made a note of this failure.

24 Oct 2020 9:24 #26526

Mecej4, you may or may not have been conscious of having your leg pulled. The correct answer was, of course, 'Touché'. I smiled when I saw that you had edited the original post - as jlb did the first time round.

Your advice to reporters of bugs was sound, and perhaps worthy of a prominent 'sticky' note somewhere on the forum.

Eddie

24 Oct 2020 9:55 #26527

Eddie, that 'correct answer' of yours did occur to me, but I did not use it since

(i) it is not a Saxon word, and

(ii) that one word reply would place the two of us, in the view of most readers, on la ligne de touche .

12 Apr 2021 12:26 #27501

mecej4

There is currenly no mechanism for stepping into included files.

For your sample, you can comment out the INCLUDE and compile the module separately. Then you will be able to step into the module when it is in its own file.

Please login to reply.