]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commit
gdb: implement readline rl_directory_rewrite_hook callback
authorAndrew Burgess <aburgess@redhat.com>
Mon, 24 Jun 2024 14:53:34 +0000 (15:53 +0100)
committerAndrew Burgess <aburgess@redhat.com>
Sat, 7 Sep 2024 19:28:58 +0000 (20:28 +0100)
commit67b8e30af907d8c19f50343268d7c6db85347ee2
tree5aa12e4efaa74cec6156ff4b6f9ebfe8b2483521
parent8f87fcb1daf1af1dd2d332f7303b02e391fa6b6c
gdb: implement readline rl_directory_rewrite_hook callback

Implement the readline rl_directory_rewrite_hook callback function,
this is used when readline needs to offer completions from within a
directory.  The important thing is that this function should remove
any escaping, this allows GDB to correctly offer completions in
situations like this:

  (gdb) file /tmp/directory\ with\ spaces/<TAB><TAB>

Note the escaping in 'directory\ with\ spaces'.  Without the
rl_directory_rewrite_hook callback readline will try to open a
directory literally called '/tmp/directory\ with\ spaces' which
obviously doesn't exist.

There are tests added to cover this new functionality.
gdb/completer.c
gdb/testsuite/gdb.base/filename-completion.exp