[patchv2 1/11] Remove xfullpath (use gdb_realpath instead)

Jan Kratochvil jan.kratochvil@redhat.com
Wed Jul 17 16:51:00 GMT 2013


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



More information about the Gdb-patches mailing list