Re: [RFC] Only compute realpath when basenames_may_differ is set

Tom de Vries
2019-06-16T22:34:25Z

On 14-06-19 16:30, Tom Tromey wrote:
>>>>>> "Tom" == Tom Tromey <tromey@adacore.com> writes:
>
> Tom> A user noted that, when sources are symlinked, gdb annotations will
> Tom> print the real path, rather than the name of the symlink.
>
> Tom> It seems to me that it is better to print the name of the file that
> Tom> was actually used in the build, unless there is some reason not to.
>
> Tom> This patch implements this, with the caveat that it will not work when
> Tom> basenames-may-differ is enabled. The way this mode is currently
> Tom> implemented, returning the symbolic (not real) path is not possible.
>
> Tom> While I think it would be good to redo the source file name cache and
> Tom> perhaps integrate it with class source_cache, I haven't done so here.
>
> Tom> Regression tested on x86-64 Fedora 29.
>
> Tom> gdb/ChangeLog
> Tom> 2019-05-30 Tom Tromey <tromey@adacore.com>
>
> Tom> * source.c (find_and_open_source): Respect basenames_may_differ.
>
> I'm checking this in now.
>

This caused PR24687 - "FAIL: gdb.base/fullname.exp: set breakpoint by
full path before/after loading symbols - built relative".

Thanks,
- Tom