🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

1 total messages Started by jimb Wed, 21 Feb 1990 06:27
finding source files
#846
Author: jimb
Date: Wed, 21 Feb 1990 06:27
40 lines
1856 bytes
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
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads