aboutsummaryrefslogtreecommitdiff
path: root/gdb/completer.h
diff options
context:
space:
mode:
authorJan Vrany <jan.vrany@fit.cvut.cz>2019-05-17 10:58:23 +0100
committerJan Vrany <jan.vrany@fit.cvut.cz>2019-05-17 10:58:23 +0100
commit6e035501e15e72398fcd9db88c97dd30e585a9ae (patch)
tree6613a2f7386b73461c6887ae1b9dd28b57229a6d /gdb/completer.h
parent7d0e2ecedef69de0a242ac49a475f6a3968d4476 (diff)
downloadgdb-6e035501e15e72398fcd9db88c97dd30e585a9ae.zip
gdb-6e035501e15e72398fcd9db88c97dd30e585a9ae.tar.gz
gdb-6e035501e15e72398fcd9db88c97dd30e585a9ae.tar.bz2
MI: extract command completion logic from complete_command()
Extract completion logic from CLI complete_command() into a new helper function complete(). gdb/Changelog: * completer.h (complete): New function. * completer.c (complete): Likewise. * cli/cli-cmds.c: (complete_command): Update to use new complete() function defined in completer.h.
Diffstat (limited to 'gdb/completer.h')
-rw-r--r--gdb/completer.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/gdb/completer.h b/gdb/completer.h
index 52f8d7d..38a0132 100644
--- a/gdb/completer.h
+++ b/gdb/completer.h
@@ -510,6 +510,13 @@ extern void complete_line (completion_tracker &tracker,
const char *line_buffer,
int point);
+/* Complete LINE and return completion results. For completion purposes,
+ cursor position is assumed to be at the end of LINE. WORD is set to
+ the end of word to complete. QUOTE_CHAR is set to the opening quote
+ character if we found an unclosed quoted substring, '\0' otherwise. */
+extern completion_result
+ complete (const char *line, char const **word, int *quote_char);
+
/* Find the bounds of the word in TEXT for completion purposes, and
return a pointer to the end of the word. Calls the completion
machinery for a handle_brkchars phase (using TRACKER) to figure out