[comp.lang.fortran] sun f77 and dbx and # line directives

mclay@vato.ae.utexas.edu (Robert McLay) (02/06/91)

I use a fortran pre-processor.  (fortran needs all the help it can get)
If you uses # line_no "file" directives in the generated fortran the compiler
very nicely reports your errors in your original source file.

HOWEVER, dbx, gets completely lost.  It returns machine instructions.
This use to work when sun handled vax fortran with the f77cvt program.
Is this ever going to get fixed?  Note that gdb doesn't do it right either.


For example a simple input file in my fortran pre-processor (say tst.cs)

        program tst
        real a(100)
        do i = 1,100
           a(i) = float(i)
        enddo
        stop

the output would be:

# 1 "tst.cs"
      program tst
      real a(100)
      do 8511 i = 1,100
         a(i) = float(i)
 8511 continue
      stop



           
--

______________________________________________________________________________
Robert McLay                   | When you have a problem, put NO in front of
Manager CFD Lab                | it and you have:  NO PROBLEM.
Dept ASE-EM                    |
University of Texas at Austin  |           -- Eric Beckman's 2nd Law
                               |
mclay@wilbur.ae.utexas.edu     |

khb@chiba.Eng.Sun.COM (Keith Bierman fpgroup) (02/06/91)

fixed in 

f77v1.4/comprable dbx

f77b -g f.f
f.f:
 MAIN tst:
$ dbx a.out
Reading symbolic information...
Read 421 symbols
(dbx) list
    3         real a(100)
    4         do 8511 i = 1,100
    5            a(i) = float(i)
    6    8511 continue
    7         stop
    8         end
(dbx) stop at 6
(2) stop at "/home2/khb/f.f":6
(dbx) run
Running: a.out 
stopped in MAIN at line 6 in file "f.f"
    6    8511 continue
(dbx) print i
i = 101
(dbx) cont

execution completed, exit code is 0
program exited with 0
(dbx) quit
$ 
--
----------------------------------------------------------------
Keith H. Bierman    kbierman@Eng.Sun.COM | khb@chiba.Eng.Sun.COM
SMI 2550 Garcia 12-33			 | (415 336 2648)   
    Mountain View, CA 94043

mclay@vato.ae.utexas.edu (Robert McLay) (02/06/91)

From what you showed.  I'm not sure it's fixed.  As far as I can tell
the dbx output referring to the generated fortran file, NOT the
original source file.  The idea behind the # line "file" directive is
to work with the source file not the generated file.  It should work
the same as lex and yacc files.  DBX refers to the lex file not the .c file.

The behavior you show is MUCH better than v1.3.1 with doesn't work with the
generated fortran file.  It appears to me that the
f77-compatable(v1.4) dbx is ignoring the # line directive.  I do
appreciate a step forward however.

Thanks.

--

______________________________________________________________________________
Robert McLay                   | When you have a problem, put NO in front of
Manager CFD Lab                | it and you have:  NO PROBLEM.
Dept ASE-EM                    |
University of Texas at Austin  |           -- Eric Beckman's 2nd Law
                               |
mclay@wilbur.ae.utexas.edu     |