X-Git-Url: http://git.efficios.com/?a=blobdiff_plain;f=gdb%2Fcompleter.h;h=313010fce2280c1b90aa637453deff7b0ad4f5ce;hb=7190276c52b9d86a52aae73d3a0f8b56e7a1f4f1;hp=52f8d7dff4f5bf25401faf904be7b5bf73568e1c;hpb=4de283e4b5f21207fe12f99913d1f28d4f07843c;p=deliverable%2Fbinutils-gdb.git diff --git a/gdb/completer.h b/gdb/completer.h index 52f8d7dff4..313010fce2 100644 --- a/gdb/completer.h +++ b/gdb/completer.h @@ -17,7 +17,7 @@ #if !defined (COMPLETER_H) #define COMPLETER_H 1 -#include "common/gdb_vecs.h" +#include "gdbsupport/gdb_vecs.h" #include "command.h" /* Types of functions in struct match_list_displayer. */ @@ -357,7 +357,7 @@ public: { m_custom_word_point = point; } /* Advance the custom word point by LEN. */ - void advance_custom_word_point_by (size_t len); + void advance_custom_word_point_by (int len); /* Whether to tell readline to skip appending a whitespace after the completion. See m_suppress_append_ws. */ @@ -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 @@ -525,10 +532,15 @@ extern const char *completion_find_completion_word (completion_tracker &tracker, completion word point for TEXT, emulating the algorithm readline uses to find the word point, using the current language's word break characters. */ - const char *advance_to_expression_complete_word_point (completion_tracker &tracker, const char *text); +/* Assuming TEXT is an filename, find the completion word point for + TEXT, emulating the algorithm readline uses to find the word + point. */ +extern const char *advance_to_filename_complete_word_point + (completion_tracker &tracker, const char *text); + extern char **gdb_rl_attempted_completion_function (const char *text, int start, int end); @@ -599,6 +611,18 @@ extern completion_list complete_source_filenames (const char *text); extern void complete_expression (completion_tracker &tracker, const char *text, const char *word); +/* Called by custom word point completers that want to recurse into + the completion machinery to complete a command. Used to complete + COMMAND in "thread apply all COMMAND", for example. Note that + unlike command_completer, this fully recurses into the proper + completer for COMMAND, so that e.g., + + (gdb) thread apply all print -[TAB] + + does the right thing and show the print options. */ +extern void complete_nested_command_line (completion_tracker &tracker, + const char *text); + extern const char *skip_quoted_chars (const char *, const char *, const char *);