[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: g77 and gdb.



gdb's fortran support still has a ways to go, but I think you will
get what you want if you instead do,

gdb hello
break MAIN__
run
list


John
--------------------------------------------------------
John Maheu                phone  (403) 492-2049
University of Alberta     email  john.maheu@ualberta.ca
Dept. of Economics
Edmonton, Alberta
Canada, T6G 2H4
--------------------------------------------------------

On Mon, 14 Sep 1998, Paulo José da Silva e Silva wrote:

> Hello,
> 
> I am sure I am doing something silly, but I can´t find out what.
> 
> I can not manage to debug fotran code compiled with g77. I am using GNU
> Fortran 0.5.24-19980804 (instaled from slink and part of the new egcs
> 1.1). Here is an exemple of what I am doing:
> 
> I try to compile the "hello world" program bellow:
> 
> 
> hello.f:
>       program hello
>       print *, "Hello World!"
>       end
> 
> 
> It works well. Then I use "g77 -g hello.f -o hello" to compile it with
> debbuging information. After that I start gdb with "gdb hello". Gdb
> complains it can´t find a file called:
>               ../../../../libf2c/libF77/main.c
> Here is sample of a gdb session:
> 
> 
> bash-2.01$ gdb hello
> GNU gdb 4.17
> Copyright 1998 Free Software Foundation, Inc.
> GDB is free software, covered by the GNU General Public License, and you
> are
> welcome to change it and/or distribute copies of it under certain
> conditions.
> Type "show copying" to see the conditions.
> There is absolutely no warranty for GDB.  Type "show warranty" for
> details.
> This GDB was configured as "i586-pc-linux-gnu"...
> (gdb) list
> ../../../../libf2c/libF77/main.c:46: No such file or directory.
> (gdb) break main
> Breakpoint 1 at 0x804ae89: file ../../../../libf2c/libF77/main.c, line
> 55.
> (gdb) run
> Starting program: /home/paulojs/programas/estudos_f90/hello 
> 
> Breakpoint 1, main (argc=1, argv=0xbffffd58)
>     at ../../../../libf2c/libF77/main.c:55
> ../../../../libf2c/libF77/main.c:55: No such file or directory.
> (gdb) list
> ../../../../libf2c/libF77/main.c:50: No such file or directory.
> (gdb) continue
> Continuing.
>  Hello World!
> 
> Program exited normally.
> (gdb) quit
> bash-2.01$
> 
> 
> What am I doing wrong?
> 
> Paulo.
> 
> 
> --  
> Unsubscribe?  mail -s unsubscribe debian-user-request@lists.debian.org < /dev/null
> 
> 


Reply to: