View previous topic :: View next topic |
Author |
Message |
maxifrost
Joined: 23 Dec 2010 Posts: 8
|
Posted: Tue Jan 04, 2011 8:06 am Post subject: Debugging subroutines and include files |
|
|
I am sure this is a very basic question but I cannot find any instruction on how to do it. When I run debug using Plato,
the CALL statements it seemed cannot be used as break points. I cannot find how to 'step' into the subroutines. The subroutines are in include files.
I would appreciate all help and pointers. Thank you. |
|
Back to top |
|
 |
jjgermis
Joined: 21 Jun 2006 Posts: 404 Location: N�rnberg, Germany
|
Posted: Tue Jan 04, 2011 8:41 am Post subject: |
|
|
I had a similar problem recently. I assume that if it is a "real" subroutine you should add it as a source file. The include statement is good e.g. common blocks and stuf like that. |
|
Back to top |
|
 |
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 8257 Location: Salford, UK
|
Posted: Tue Jan 04, 2011 9:29 am Post subject: |
|
|
If you want to step into a subroutine then it must have been compiled using one of the debugging switches on the FTN95 command line, e.g. /DEBUG, /CHECK, /CHECKMATE etc.
DEBUG and CHECKMATE are standard options in Plato and the FTN95 Visual Studio plugin. |
|
Back to top |
|
 |
maxifrost
Joined: 23 Dec 2010 Posts: 8
|
Posted: Tue Jan 04, 2011 10:53 am Post subject: |
|
|
Yes, I did compile the files separately and in one project using the debug option. When I used 'step', it went to the call line and stayed there. Then I used step again and it went to the end of the main programme and stayed there. The 'step' command did not come up again until the programme gave a division by 0 statement and stopped. The include file statements are placed after the main programme.
I guess I should do what jjgermis is suggesting ( I think) i.e. to recombine it all into one file and debug it. Is there an easier way? |
|
Back to top |
|
 |
sparge
Joined: 11 Apr 2005 Posts: 371
|
Posted: Tue Jan 04, 2011 11:16 am Post subject: |
|
|
There are two sorts of "step": "step into" and "step over". You need to be stepping "into". |
|
Back to top |
|
 |
jjgermis
Joined: 21 Jun 2006 Posts: 404 Location: N�rnberg, Germany
|
Posted: Tue Jan 04, 2011 12:12 pm Post subject: |
|
|
I tried the code below (thinking that is what you meant). This does not work no matter what compiler option you use (I use Plato as well). Instead of include 'ins.for' (or whatever the filename) does not work. In Plato you have to:
1.) right click on source files and
2.) insert ins.for as an (existing) source file.
At least this works fine on my system. Somehow Plato does not recognise include files automatically as source files.
Code: |
program step
implicit none
write(*,*) 'in the main program'
write(*,*) 'going to call subroutine now'
call sub
write(*,*) 'returned from sub'
end
include 'ins.for' |
|
|
Back to top |
|
 |
maxifrost
Joined: 23 Dec 2010 Posts: 8
|
Posted: Tue Jan 04, 2011 5:23 pm Post subject: |
|
|
Yes, that's what I have. OK will try your method. Thank you. |
|
Back to top |
|
 |
maxifrost
Joined: 23 Dec 2010 Posts: 8
|
Posted: Tue Jan 04, 2011 5:25 pm Post subject: Re: |
|
|
sparge wrote: |
There are two sorts of "step": "step into" and "step over". You need to be stepping "into". |
Quite sure I did'nt see step into or I would have used it. I'll check it again. Thank you. |
|
Back to top |
|
 |
|