This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [patchv2 1/11] Remove xfullpath (use gdb_realpath instead)
- From: Jan Kratochvil <jan dot kratochvil at redhat dot com>
- To: Doug Evans <dje at google dot com>
- Cc: "Agovic, Sanimir" <sanimir dot agovic at intel dot com>, "gdb-patches at sourceware dot org" <gdb-patches at sourceware dot org>, Cary Coutant <ccoutant at google dot com>, Sterling Augustine <saugustine at google dot com>
- Date: Wed, 17 Jul 2013 18:50:45 +0200
- Subject: Re: [patchv2 1/11] Remove xfullpath (use gdb_realpath instead)
- References: <20130127223135 dot GB15252 at host2 dot jankratochvil dot net> <0377C58828D86C4588AEEC42FC3B85A71762FE8D at IRSMSX105 dot ger dot corp dot intel dot com> <CADPb22ScQEbgW3-Owy8tAaqxRH5vxQAc3n8JCOT_47u9Y6enMw at mail dot gmail dot com> <CADPb22SG24NvuUzRENYDT2QnEr7n+2cTtfErj1nPKBxFs9tFZA at mail dot gmail dot com>
On Wed, 17 Jul 2013 18:12:53 +0200, Doug Evans wrote:
> Ah, forgot a reason. [How not unexpected, sigh.]
>
> If a binary has an auxiliary file (e.g., a separate debug info file or
> a -gdb.py file) then gdb won't be able to find them - the auxiliary
> files could be named and/or located based on the realpath name.
In general GDB does many comparison for file identity by:
strcmp (xfullpath (a), xfullpath (b)) == 0
It would be much more efficient to do:
stat (a).st_{dev,ino} == stat (b).st_{dev,ino}
Going to check what to do with the argv[0] problem, there seems to be xfullpath
excessive.
I do not know what happens with ${binary}.dwp. But .debug files were always
symlinked similar way to their original binary files:
lrwxrwxrwx 1 root root 27 Jun 19 00:23 /lib64/libgtk-x11-2.0.so -> libgtk-x11-2.0.so.0.2400.19*
lrwxrwxrwx 1 root root 27 Jun 19 00:23 /lib64/libgtk-x11-2.0.so.0 -> libgtk-x11-2.0.so.0.2400.19*
-rwxr-xr-x 1 root root 4779088 Jun 16 22:05 /lib64/libgtk-x11-2.0.so.0.2400.19*
lrwxrwxrwx 1 root root 33 Jun 19 00:23 /usr/lib/debug/lib64/libgtk-x11-2.0.so.debug -> libgtk-x11-2.0.so.0.2400.19.debug
lrwxrwxrwx 1 root root 33 Jun 19 00:23 /usr/lib/debug/lib64/libgtk-x11-2.0.so.0.debug -> libgtk-x11-2.0.so.0.2400.19.debug
-r--r--r-- 1 root root 13663732 Jun 16 22:05 /usr/lib/debug/lib64/libgtk-x11-2.0.so.0.2400.19.debug
So I would say this is a bug in the script generating *.dwp, isn't it?
Jan