|
forums.silverfrost.com Welcome to the Silverfrost forums
|
View previous topic :: View next topic |
Author |
Message |
mecej4
Joined: 31 Oct 2006 Posts: 1895
|
Posted: Fri Oct 23, 2020 7:18 pm Post subject: Line number debug information lost when module is INCLUDEd |
|
|
The source file mymod.f90 contains:
Code: | 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
Code: | 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.
Last edited by mecej4 on Fri Oct 23, 2020 11:42 pm; edited 2 times in total |
|
Back to top |
|
|
LitusSaxonicum
Joined: 23 Aug 2005 Posts: 2391 Location: Yateley, Hants, UK
|
Posted: Fri Oct 23, 2020 8:06 pm Post subject: |
|
|
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. |
|
Back to top |
|
|
mecej4
Joined: 31 Oct 2006 Posts: 1895
|
Posted: Sat Oct 24, 2020 1:43 am Post subject: |
|
|
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 |
|
Back to top |
|
|
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 7938 Location: Salford, UK
|
Posted: Sat Oct 24, 2020 8:30 am Post subject: |
|
|
mecej4
Thank you for the feedback. I have made a note of this failure. |
|
Back to top |
|
|
LitusSaxonicum
Joined: 23 Aug 2005 Posts: 2391 Location: Yateley, Hants, UK
|
Posted: Sat Oct 24, 2020 10:24 am Post subject: |
|
|
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 |
|
Back to top |
|
|
mecej4
Joined: 31 Oct 2006 Posts: 1895
|
Posted: Sat Oct 24, 2020 10:55 am Post subject: |
|
|
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 . |
|
Back to top |
|
|
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 7938 Location: Salford, UK
|
Posted: Mon Apr 12, 2021 1:26 pm Post subject: |
|
|
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. |
|
Back to top |
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|