aboutsummaryrefslogtreecommitdiff
path: root/gdb/completer.h
diff options
context:
space:
mode:
authorAndrew Burgess <aburgess@redhat.com>2024-07-02 09:18:55 +0100
committerAndrew Burgess <aburgess@redhat.com>2024-09-07 20:28:59 +0100
commit1be3b2e82f7a2a95d194b2c06d7c961fdbb42a66 (patch)
treed3494d02173ce4fe2fa43419eb28d23ff80af313 /gdb/completer.h
parent1217ae6726a867aac7faf8e52271a21788064996 (diff)
downloadbinutils-1be3b2e82f7a2a95d194b2c06d7c961fdbb42a66.zip
binutils-1be3b2e82f7a2a95d194b2c06d7c961fdbb42a66.tar.gz
binutils-1be3b2e82f7a2a95d194b2c06d7c961fdbb42a66.tar.bz2
gdb: extend completion of quoted filenames to work in brkchars phase
Up to this point filename completion for possibly quoted filenames has always been handled during the second (non-brkchars) phase of completion. This works fine for commands that only want to complete on a single filename argument. In a later commit though I need to perform completion of a quoted filename argument during the first (brkchars) phase of completion. This will allow me to add a custom completer that completes both command options and arguments for a command (remove-symbol-file) that takes a possibly quoted filename argument. This commit doesn't add the remove-symbol-file completer, this commit is just about putting support for that in place. To achieve this I've added the new function advance_to_filename_maybe_quoted_complete_word_point, which is unused in this commit. I've then had to extend some other functions in order to extract the quoting state during the brkchars phase. As this commit doesn't use the new functionality, the important thing at this point is that I've not regressed the existing filename completion (or any of the other completion). The next commit in this series will make use of the new functionality, and will include tests. There should be no user visible changes after this commit.
Diffstat (limited to 'gdb/completer.h')
-rw-r--r--gdb/completer.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/gdb/completer.h b/gdb/completer.h
index c18bd16..44eafc4 100644
--- a/gdb/completer.h
+++ b/gdb/completer.h
@@ -618,6 +618,14 @@ const char *advance_to_expression_complete_word_point
extern const char *advance_to_deprecated_filename_complete_word_point
(completion_tracker &tracker, const char *text);
+/* Assuming TEXT is a filename, find the completion word point for TEXT,
+ emulating the algorithm readline uses to find the word point. The
+ filenames that are located by this function assume that filenames
+ can be quoted, this function should be paired with
+ filename_maybe_quoted_completer. */
+extern const char *advance_to_filename_maybe_quoted_complete_word_point
+ (completion_tracker &tracker, const char *text);
+
extern void noop_completer (struct cmd_list_element *,
completion_tracker &tracker,
const char *, const char *);