.../main.c: No such file or directory

Toon Moene toon@moene.indiv.nluug.nl
Wed Oct 3 13:46:00 GMT 2001


Wanyu Li wrote:

> (gdb) file ttt
> Load new symbol table from "ttt"? (y or n) y
> Reading symbols from ttt...done.
> (gdb) list
> 46      ../../../../libf2c/libF77/main.c: No such file or directory.
> 
>  Do you think it would be a problem else?

Whooops - I completely misread your problem report.  Yes, this has
another cause then a missing main program in your Fortran source.

The problem is that g77 doesn't build a main program that's recognisable
by gdb - it links in a "main program" from the libg2c.a library (it's
the easiest way to make it possible that Fortran programs can access
command line arguments with iargc() and getarg(n,arg).  The consequence
of this is that the debugger drops you into *this* main program, that is
written in C.

It's documented in the g77 manual that to circumvent this, you'll have
to say:

break MAIN__

before running your program in gdb.  When gdb then stops, you are able
to see the start of your Fortran program (and gdb knows that the
language is Fortran).

Hope this helps,
 
-- 
Toon Moene - mailto:toon@moene.indiv.nluug.nl - phoneto: +31 346 214290
Saturnushof 14, 3738 XG  Maartensdijk, The Netherlands
Maintainer, GNU Fortran 77: http://gcc.gnu.org/onlinedocs/g77_news.html
Join GNU Fortran 95: http://g95.sourceforge.net/ (under construction)



More information about the Gcc-help mailing list