[RFC gdb 9] Revert basenames_may_differ patch

Simon Marchi simark@simark.ca
Fri Feb 7 20:53:00 GMT 2020


On 2020-02-07 2:38 p.m., Tom Tromey wrote:
>>>>>> "Joel" == Joel Brobecker <brobecker@adacore.com> writes:
> 
> Joel> Thanks for the patch. I think this is the most reasonable thing
> Joel> to do. Can you apply it?
> 
> I'm going to apply it to the gdb 9 branch shortly.  I suppose I will
> apply to master as well and then open a bug about the problem.
> 
> Tom

I had a prototype of a fix here:

  https://github.com/simark/binutils-gdb/commits/symtab-realpath

My idea is simply that we should keep both versions of the symtab path:

- an absolute path where we have not resovled the symlinks and all (i.e. a
  non-canonical version)
- a path passed through realpath, so where the symlinks and ".." have been resolved
  (i.e a canonical version)

Different parts of GDB would use the one they prefer.  It is described in more
details here:

https://sourceware.org/ml/gdb-patches/2020-02/msg00008.html

If you think this is a good direction, I could clean up the patch and submit
it for real (after some more testing to make sure it actually does what we
want).

I don't remember exactly, but I think that my patch ends up removing your
change anyway, because it goes back to always computing the realpath, regardless
of basenames_may_differ (on top of also keeping the non-real absolute path around).

Simon



More information about the Gdb-patches mailing list