This is the mail archive of the
gdb@sources.redhat.com
mailing list for the GDB project.
Re: Source files as symlinks for 5.2.1
- From: Albert Chin <gdb at thewrittenword dot com>
- To: gdb at sources dot redhat dot com
- Cc: peter dot torngaard at nokia dot com
- Date: Tue, 12 Nov 2002 17:59:29 -0600
- Subject: Re: Source files as symlinks for 5.2.1
- References: <20021112172303.A63062@oolong.il.thewrittenword.com>
- Reply-to: gdb at sources dot redhat dot com
On Tue, Nov 12, 2002 at 05:23:03PM -0600, Albert Chin wrote:
> On Redhat Linux 7.1 with GDB 5.2.1:
> $ mkdir /tmp/a /tmp/b
> $ cd /tmp/a
> $ ln -s ../b/sample.c link.c
> $ ls -ld link.c
> ... link.c -> ../b/sample.c
> $ gcc -g link.c
> $ gdb a.out
> (gdb) list
> (gdb) info source
> Current source file is link.c
> Compilation directory is /tmp/a/
> Located in /tmp/b/sample.c
> Contains 6 lines.
> Source language is c.
> Compiled with stabs debugging format.
>
> Why isn't the source file '/tmp/a/link.c'?
And:
(gdb) set annotate 1
(gdb) info line
...
Line ...
and ends at ...
/tmp/b/sample.c:...
DDD is reading the output of 'info line' at annotation level 1 and
using sample.c as the filename to set the breakpoint for. As 'link.c'
is loaded instead, 'set breakpoint sample.c:[line #]' this fails.
Oddly enough the HP wdb debugger doesn't read the link.
--
albert chin (china@thewrittenword.com)