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.