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 

SDBG64 won't show values in arg. array even if /debug used

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



Joined: 31 Oct 2006
Posts: 1031

PostPosted: Thu Nov 29, 2018 12:36 pm    Post subject: SDBG64 won't show values in arg. array even if /debug used Reply with quote

When debugging old programs, it is not always feasible to compile with /check because many such programs have benign violations of subscript bounds. Yet they work as intended, and it is helpful to be able to test modified versions of such programs in SDBG/SDBG64. Consider the following example program.

Code:
program sdbgbug
implicit none
integer i
real x(5),s
do i=1,5
   x(i)=sqrt(float(i))
end do
call sub(3,x(2),s)  ! obtain sum of 3 elements starting with x(2)
print *,'F77 way, passing address of first element ',s
call sub(3,x(2:4),s)
print *,'Passing array section ', s
print *,s
end program

subroutine sub(n,x,s)
implicit none
integer n
real x(*),s
s=sum(x(1:n))     !place break here and try to examine values in x
return
end subroutine

When I compile this with /debug and run inside SDBG/SDBG64, when the breakpoint in SUB is reached, I see "X = REAL*4 (*Invalid*)" in the variables pane. Nevertheless, in the 32-bit case, clicking on X shows the first ten elements of the array, so debugging can be continued and this mode of operation is feasible and the "(*Invalid*)" label is just a minor nuisance. In the 64-bit case, clicking on X does not work, so debugging programs compiled with only /debug is severely hampered; please rectify this.

A minor issue relates to the behaviour when /debug /check is used. In this case, the compiler can definitely produce debug information for the size of the actual argument X(2:4), yet the debugger shows 4 values instead of the expected 3.
Back to top
View user's profile Send private message
LitusSaxonicum



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

PostPosted: Thu Nov 29, 2018 12:45 pm    Post subject: Reply with quote

Is this a case where the compiler switch /OLD_ARRAYS is required?

Eddie
Back to top
View user's profile Send private message
mecej4



Joined: 31 Oct 2006
Posts: 1031

PostPosted: Thu Nov 29, 2018 12:51 pm    Post subject: Re: Reply with quote

LitusSaxonicum wrote:
Is this a case where the compiler switch /OLD_ARRAYS is required?
Eddie

Not in the code that I am working with; all argument arrays are declared with either the correct dimensions, when known, or with '(*)' or '(*,*)'.
Back to top
View user's profile Send private message
LitusSaxonicum



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

PostPosted: Thu Nov 29, 2018 1:01 pm    Post subject: Reply with quote

It was the 'benign violations of subscript bounds' that set me off. Not that I know owt of the internals of FTN95, of course.

Eddie
Back to top
View user's profile Send private message
Robert



Joined: 29 Nov 2006
Posts: 250
Location: Manchester

PostPosted: Sat Dec 01, 2018 1:15 pm    Post subject: Reply with quote

The sdbg behaviour is a bug turned into a feature. Some weird 64-bit point stuff meant that sdbg64 saw an error and sdbg ignored it. I have tried to turn off the error in sdbg64 - I am not sure if it is 100% but your example works:

http://www.ftn95.co.uk/ftn95/sdbg64.zip
Back to top
View user's profile Send private message Visit poster's website
mecej4



Joined: 31 Oct 2006
Posts: 1031

PostPosted: Sun Dec 02, 2018 3:12 pm    Post subject: Reply with quote

I tried out the new SDBG64 on the full program, and found that the deficiency that I reported is no longer present.

Thanks, Robert!
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 -> 64-bit 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