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 

Setting a breakpoint in an subprogram (INCLUDED)

 
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> Plato
View previous topic :: View next topic  
Author Message
Anonymous
Guest





PostPosted: Tue May 30, 2006 4:52 am    Post subject: Setting a breakpoint in an subprogram (INCLUDED) Reply with quote

I'm considering purchasing FTN95 in order to run Fortran 77 programs currently on a mainframe. I've succeeded in running one suite of programs (even getting exactly the same answer !). However the programs have been statically linked and so are in the form of a top program and subprograms, for which I've used INCLUDE statements. I can't see how to set a breakpoint in a subprogram, if that's possible, as my second suite of programs crashes. If it's not possible how would you recommend debugging a subprogram which is exceeding an array limit ?

Possibly including subprograms is not the best way of doing this (would DLLs be better ? ) but I just need to demonstrate success in porting programs over to the PC so I can justify the purchase.

In case it's relevant I've been using the FTN95 compiler though the code was originally Fortran 77.

Thanks.





ckerr
Back to top
PaulLaidler
Site Admin


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

PostPosted: Tue May 30, 2006 5:57 am    Post subject: Setting a breakpoint in an subprogram (INCLUDED) Reply with quote

You must use one of the debugging options (/DEBUG, /CHECKMATE etc) when compiling the subprograms.

Then you can run the debugger and open the file containing the point where you want to break.
Go to the line and set the break point (F2 I think).

Alternatively, within Plato3 there is a "run to cursor" command that you could try. Go get this from a right click popup menu.
Back to top
View user's profile Send private message AIM Address
Anonymous
Guest





PostPosted: Tue May 30, 2006 6:33 am    Post subject: Setting a breakpoint in an subprogram (INCLUDED) Reply with quote

Sorry, maybe I'm being thick, but it won't compile a subprogram. The option is greyed out when I open a subprogram. I assumed this was because it doesn't make sense to try and compile an 'include' file.

ckerr
Back to top
PaulLaidler
Site Admin


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

PostPosted: Tue May 30, 2006 9:45 am    Post subject: Setting a breakpoint in an subprogram (INCLUDED) Reply with quote

Plato3 does not compile INCLUDE files.
Just remove the INCLUDE statements and add the files to your project as source files.
When you call an external FUNCTION make sure that you declare its return type.
Back to top
View user's profile Send private message AIM Address
Anonymous
Guest





PostPosted: Tue May 30, 2006 10:21 am    Post subject: Setting a breakpoint in an subprogram (INCLUDED) Reply with quote

I had been led to believe (through previously trying another compiler) that the statically linked programs from the mainframe had to be 'INCLUDE' files. This worked fine on the first suite of programs as I didn't have any problem getting the result to run through. Once I had the INCLUDE statements in place Plato very conveniently added them to the project encouraging my belief I was doing the right thing.

Now instead, adding the subprogram as source results in Plato removing it from the INCLUDE files view and once I'd removed the INCLUDE from the calling program and recompiled I found I could indeed set a breakpoint and resolve the problem.

Almost certain now we'll be purchasing this - thanks for your help.

ckerr
Back to top
PaulLaidler
Site Admin


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

PostPosted: Tue May 30, 2006 10:58 am    Post subject: Setting a breakpoint in an subprogram (INCLUDED) Reply with quote

Thanks for the reply.

However, I need to clarify my earlier advise.

It is common practice to use INCLUDE files for "header" information and occasionally for COMMON BLOCKs that are repeated throughout the project. They are not commonly used for normal source code.

Plato3 simply passes a "source" file to FTN95 for compilation. FTN95 will copy INCLUDEd files into the source. So in a sense what you were doing will work up to a point.

The real question is how does the debugger handle INCLUDEd files and does it allow you to step into these files. Since this is not standard practise I do not know off hand how the debugger respoinds in this situation but since you now have a working method you may as well stick with the usual way of doing things.
Back to top
View user's profile Send private message AIM Address
Display posts from previous:   
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> Plato 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