[PATCH 0/6] Further filename completion improvements

Andrew Burgess
2024-03-29T11:43:06Z

This series continues my efforts to improve filename completion.

After this series I believe GDB will be ready to add filename options
(to the option sub-system), though I haven't done that in this series,
I want to see if there are any objections to the direction I'm going
in.

But even without the filename options, this series adds some nice
improvements: GDB's filename completion (both TAB and 'complete'
command) now handles escaped whitespace and quotes correctly, and the
'complete' command now correctly displays filenames that require
escaping, and better handles the trailing quote when a 'complete'
command returns a directory.

---

Andrew Burgess (6):
gdb: improve escaping when completing filenames
gdb: move display of completion results into completion_result class
gdb: simplify completion_result::print_matches
gdb: add match formatter mechanism for 'complete' command output
gdb: apply escaping to filenames in 'complete' results
gdb: improve gdb_rl_find_completion_word for quoted words

gdb/cli/cli-cmds.c | 26 +-
gdb/completer.c | 389 +++++++++++++++---
gdb/completer.h | 47 ++-
.../gdb.base/filename-completion.exp | 118 +++++-
4 files changed, 494 insertions(+), 86 deletions(-)

base-commit: 56f703d39d6f4793ba73b2364a4ea052e8ad755d
--
2.25.4