www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/02/09/11:20:19

From: D DOT J DOT Murdoch AT bristol DOT ac DOT uk (Duncan Murdoch)
To: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
Cc: djgpp AT delorie DOT com
Subject: Re: f2c, djgpp, and gdb
Date: Sun, 09 Feb 1997 16:08:19 GMT
Message-ID: <32fddf95.25796875@hannan.stats.bris.ac.uk>
References: <Pine DOT SUN DOT 3 DOT 91 DOT 970209132745 DOT 859C-100000 AT is>
In-Reply-To: <Pine.SUN.3.91.970209132745.859C-100000@is>
MIME-Version: 1.0

On Sun, 9 Feb 1997 13:30:14 +0200 (IST), you wrote:

>I think this is one of the adverse effects of the basic deficiency in the 
>COFF debugging info that DJGPP uses.  See section 12.8 of the DJGPP FAQ 
>list for more on this.

Thanks for the pointer.  I read that, but I was hoping there was a way
around it.  It says that COFF can only handle a single source file per
object module.  That's all I've got; I'd be happy to have it forget
all about the .c file, and just record the line correspondence from
the .f file.  

12.8 also says that "It does include correct line numbers, but the
name of the source file is wrong, so debugging such files just doesn't
work."  I just decided to try copying the .f file on top of the .c
(after compiling, of course), and it works!

So here is the answer to my question:

To debug a Fortran program "myprog.f" using f2c, gcc and gdb:

  1.  Run f2c with the -g option:
          
         f2c -g myprog.f

  2.  Compile using gcc with the -g option.

         gcc -g myprog.c   -o myprog.exe -lf2c -lm

  3.  Copy the fortran over myproc.c:

         copy myprog.f myprog.c

  4.  Run gdb:

         gdb myprog.exe

Duncan Murdoch

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019