Silverfrost Forums

Welcome to our forums

Debugging subroutines and include files

4 Jan 2011 7:06 #7353

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.

4 Jan 2011 7:41 #7354

I had a similar problem recently. I assume that if it is a 'real' subroutine you should add it as a source file. The [color=blue:a4667fe015]include[/color:a4667fe015] statement is good e.g. common blocks and stuf like that.

4 Jan 2011 8:29 #7356

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.

4 Jan 2011 9:53 #7357

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?

4 Jan 2011 10:16 #7358

There are two sorts of 'step': 'step into' and 'step over'. You need to be stepping 'into'.

4 Jan 2011 11:12 #7360

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.

      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'
4 Jan 2011 4:23 #7362

Yes, that's what I have. OK will try your method. Thank you.

4 Jan 2011 4:25 #7363

Quoted from sparge 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.

Please login to reply.