[patch 0/9] Absolute filenames

Jan Kratochvil jan.kratochvil@redhat.com
Sun Feb 3 17:59:00 GMT 2013


On Fri, 18 Jan 2013 13:30:15 +0100, Joel Brobecker wrote:
> I think it was me who introduced this patch. I found:
> http://www.sourceware.org/ml/gdb-patches/2002-03/msg00345.html

FYI now with the patchset checked in the inability to place a breakpoint on the
real filename is now fixed, so the xfullpath vs. gdb_realpath displayed
filename even should not matter anymore.

$ gcc -o toto toto.c -g
$ ls -l toto*
-rwxr-xr-x 1 jkratoch jkratoch 17781 Jan 25 18:14 toto*
-rw-r--r-- 1 jkratoch jkratoch    61 Jan 18 20:00 toto.C
lrwxrwxrwx 1 jkratoch jkratoch     6 Jan 18 20:02 toto.c -> toto.C
$ readelf -wi toto
    <11>   DW_AT_name        : (indirect string, offset: 0x1a): toto.c  
$ gdb
(gdb) file toto
Reading symbols from /home/jkratoch/t/toto...done.
(gdb) set basenames-may-differ on
(gdb) set annotate 1
(gdb) break break_me
Breakpoint 1 at 0x4004f0: file toto.c, line 4.
(gdb) run
Starting program: /home/jkratoch/t/toto 
Breakpoint 1, break_me () at toto.c:4
---OLD---XX/home/jkratoch/t/toto.c:4:23:beg:0x4004f0
+++NEW+++XX/home/jkratoch/t/toto.C:4:23:beg:0x4004f0
(gdb) break toto.c:4
Breakpoint 2 at 0x4004f0: file toto.c, line 4.
(gdb) break toto.C:4
---OLD---No source file named toto.C.
+++NEW+++Breakpoint 3 at 0x4004f0: file toto.c, line 4.


Because gdb_realpath and compare_filenames_for_search are now always applied
(respecting set basenames-may-differ so it should have no real performance
impact).


Thanks,
Jan



More information about the Gdb-patches mailing list