Re: [RFC] gdb_realpath causes problems with GVD

Andrew Cagney
2002-03-20T16:10:10Z

> On Wed, 20 Mar 2002, Joel Brobecker wrote:
>
>
>> I have a sad news: filename
>> completion does not work in the case you mentionned, but this issue is
>> not related to my change. I tried with an unmodified GDB, and got the
>> same behavior.
>
>
> What version of GDB was that, and what debug info format does your
> compiler use?
>
>
>> I also tried without a simple example without any
>> symbolic link, and it did not work either. It only completes if we enter
>> the filename without the directory prefix, with and without my change.
>
>
> This certainly works for me, at least in GDB 5.1.1 with stabs and DWARF2
> debug info. It doesn't work with COFF debug info, but that's because
> COFF doesn't record the leading directories, only the basename.

If the auto-configury fails, gdb_realpath() returns xstrdup of the
original string. Since 5.1.1 people have been wacking that bit of
configury and the corresponding function so that it ``works'' (as in
implements realpath() semantics) on more platforms. I think it is that
``wacking'' that has revealed the regression - in 5.1.1 gdb_realpath()
on your platform probably wasn't doing anything.

Joel's patch makes things slightly better - it stops the basename part
from being messed up (what happens if there is no path?) - while neither
helping nor hindering the regression. It does need a testcase. Since
the completer has regressions, xfullpath() can't be indirectly tested
using that -> need to directly test xfullpath() -> need the white-box
directory -> stay tuned.

Joel, can you please create a testcase along the lines of
gdb.base/selftest.exp that tests xfullpath() using gdb. I'll find a
directory for you to put it in!

--

This just leaves us with the regression. The question here is should
the path expansion be disabled or the problems fixed.

enjoy,
Andrew