forums.silverfrost.com Forum Index forums.silverfrost.com
Welcome to the Silverfrost forums
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Line number debug information lost when module is INCLUDEd

 
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> Support
View previous topic :: View next topic  
Author Message
mecej4



Joined: 31 Oct 2006
Posts: 1429

PostPosted: Fri Oct 23, 2020 7:18 pm    Post subject: Line number debug information lost when module is INCLUDEd Reply with quote

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
View user's profile Send private message
LitusSaxonicum



Joined: 23 Aug 2005
Posts: 2184
Location: Yateley, Hants, UK

PostPosted: Fri Oct 23, 2020 8:06 pm    Post subject: Reply with quote

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
View user's profile Send private message
mecej4



Joined: 31 Oct 2006
Posts: 1429

PostPosted: Sat Oct 24, 2020 1:43 am    Post subject: Reply with quote

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
View user's profile Send private message
PaulLaidler
Site Admin


Joined: 21 Feb 2005
Posts: 6590
Location: Salford, UK

PostPosted: Sat Oct 24, 2020 8:30 am    Post subject: Reply with quote

mecej4

Thank you for the feedback. I have made a note of this failure.
Back to top
View user's profile Send private message AIM Address
LitusSaxonicum



Joined: 23 Aug 2005
Posts: 2184
Location: Yateley, Hants, UK

PostPosted: Sat Oct 24, 2020 10:24 am    Post subject: Reply with quote

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
View user's profile Send private message
mecej4



Joined: 31 Oct 2006
Posts: 1429

PostPosted: Sat Oct 24, 2020 10:55 am    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> Support All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
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