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

Eli Zaretskii
2024-04-12T18:45:22Z

> From: Andrew Burgess <aburgess@redhat.com>
> Cc: gdb-patches@sourceware.org
> Date: Fri, 12 Apr 2024 18:42:12 +0100
>
> > (gdb) file '/tmp/xx<TAB>
> > => (gdb) file '/tmp/xx/'
> > (gdb) file '/tmp/xx/'a<TAB>
> > => (gdb) file '/tmp/xx/abcd'
> >
> > That is, allow to type after the closing quote, and remove the closing
> > quote before trying to complete. This way, the user can use
> > '/tmp/xx/' if that is what she needs, or continue typing and
> > completing if not.
>
> That does sound better. I think there are still things that would need
> figuring out. For example, what if the user didn't do the second tab
> completion, but just kept typing.
>
> (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.