This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

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


Thanks a lot, Toon. It works and has been the great help. 

Wanyu
----------------------------------- 
500 w Prospec St.  
6H Aggie Village 
Ft.,Collins,80521 CO,U.S.A
tel:970-491-7192(w),970-491-6758(w),970-491-8898(h)  
email: 
 wanyu_li@engr.colostate.edu
 wanyu_li@yahoo.com
----------------------------------


On Wed, 3 Oct 2001, Toon Moene wrote:

> 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)
> 


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]