Re: [PATCH 4/6] gdb: add match formatter mechanism for 'complete' command output

Eli Zaretskii
2024-04-13T06:39:51Z

> From: Andrew Burgess <aburgess@redhat.com>
> Cc: lsix@lancelotsix.com, gdb-patches@sourceware.org
> Date: Fri, 12 Apr 2024 23:29:02 +0100
>
> Eli Zaretskii <eliz@gnu.org> writes:
>
> >> (gdb) file '/tmp/xx<TAB>
> >> => (gdb) file '/tmp/xx/'
> >> (gdb) file '/tmp/xx/'abcd<ENTER>
> >> => ?? What would this do?
> >>
> >> What if there really was a file /tmp/xx/'abcd ? What happens then?
> >
> > ENTER does the same as TAB, and then submits the result. So GDB will
> > see '/tmp/xx/abcd' in that case.
>
> This all sounds great. Do you know of any other readline based projects
> that do completion like this?

No, not off the top of my head.

Ironically, the Windows shell cmd.exe does behave like that.

> Maybe then you know that readline can be made to do things differently
> (hence me asking for examples). Or maybe you're suggesting we should
> forget readline and do things as you suggest ... I'm just trying to
> figure out what you ideal end result is here.

If Readline doesn't want to go this way, I think in the long run GDB
should develop its own completion machinery. But I'm okay with
leaving that alone for now.