Re: [PATCH 2/6] gdb: move display of completion results into completion_result class

Eli Zaretskii
2024-03-29T12:14:46Z

> From: Andrew Burgess <aburgess@redhat.com>
> Cc: Andrew Burgess <aburgess@redhat.com>
> Date: Fri, 29 Mar 2024 11:42:28 +0000
>
> When using the 'complete' command to complete file names we have some
> problems. The suggested completion should include any required
> escaping, so if there is a filename '/tmp/aa"bb' (without the single
> quotes), then this should be displayed in the completion output like:
>
> (gdb) complete file /tmp/aa
> file /tmp/aa\"bb

Why should it be displayed with the backslash? And would the
completed name, if passed to a command, also have the backslash added?
If so, it could cause some commands to fail; basically, you are adding
shell file-name semantics into commands that don't work via the shell.

So I'm not sure I understand what is being intended here, and I'm
afraid you will uncover a lot of problems as you go with this (as you
already discovered).

Apologies if I'm missing something important here.