[gnu.gdb.bug] finding source files

jimb@occs.cs.oberlin.edu (02/21/90)

In the following sequence, gdb cannot list the source code the first
time, and can the second time.  It seems to me that gdb ought to be
able to find the source code both times.

betty% cat > foo.c
main() { write(1, "hi.\n", 4); }
betty% gcc -g foo.c -o foo
betty% foo
hi.
betty% mkdir bar
betty% cd bar
betty% gdb ../foo
GDB 3.4, Copyright (C) 1989 Free Software Foundation, Inc.
There is ABSOLUTELY NO WARRANTY for GDB; type "info warranty" for details.
GDB is free software and you are welcome to distribute copies of it
 under certain conditions; type "info copying" to see the conditions.
Reading symbol data from /usr/users/students/blandy/honors/bar/../foo...done.
Type "help" for a list of commands.
(gdb) list main
Reading in symbols for foo.c...done.
foo.c: No such file or directory.
(gdb) quit
betty% cd ..
betty% gdb foo
GDB 3.4, Copyright (C) 1989 Free Software Foundation, Inc.
There is ABSOLUTELY NO WARRANTY for GDB; type "info warranty" for details.
GDB is free software and you are welcome to distribute copies of it
 under certain conditions; type "info copying" to see the conditions.
Reading symbol data from /usr/users/students/blandy/honors/foo...done.
Type "help" for a list of commands.
(gdb) list main
Reading in symbols for foo.c...done.
1	main() { write(1, "hi.\n", 4); }
(gdb) quit
betty% 


Is it perhaps not searching the executable's directory for the source file?

Jim Blandy - jimb@occs.cs.oberlin.edu