Re: [RFC] gdb_realpath causes problems with GVD

Joel Brobecker
2002-03-19T20:14:04Z

> I'm not sure yet. My doubt stems from the fact that directories are
> also recorded in the debug info, at least with some formats (stabs,
> DWARF2). One place in GDB where we use this is in file-name
> completion, for example when you type "break /foo TAB" and want GDB
> to complete this to "break /foobar/foo.c" (assuming that there's only
> one file foo.c in that directory that was compiled into the program).
>
> Will this break if symlinks are followed in the directory part, but
> not in the file-name part?

It seems it does. With the same example where I built toto from
toplevel_link/symlink (reminder toplevel_link is a symbolic link to
toplevel), here is what is recoded in stabs,

<<
.stabs "/bonn.a/brobecke/toplevel_link/symlinks/",100,0,0,.Ltext0
^^^^^^^^^^^^^
.stabs "toto.c",100,0,0,.Ltext0
>>

And here is a GDB session showing that with both paths:
<<
(gdb) b break_me
Breakpoint 1 at 0x8048433: file toto.c, line 4.
(gdb) set annotate 1
(gdb) run
Starting program: /bonn.a/brobecke/toplevel/symlinks/toto

Breakpoint 1, break_me () at toto.c:4
yy/bonn.a/brobecke/toplevel/symlinks/toto.c:4:23:beg:0x8048433
(gdb) b /bonn.a/brobecke/toplevel/symlinks/toto.c:4
Note: breakpoint 1 also set at pc 0x8048433.
Breakpoint 2 at 0x8048433: file toto.c, line 4.
(gdb) b /bonn.a/brobecke/toplevel_link/symlinks/toto.c:5
Breakpoint 3 at 0x8048438: file toto.c, line 5.
>>

--
Joel