X-Git-Url: https://git.libre-soc.org/?a=blobdiff_plain;f=gdb%2Fcompleter.c;h=3ba481ee52c4f75ac69584c8f64e7eec68001d97;hb=51d7d80300853eac20339390e1ae05de71e7e1e3;hp=02e95110114d87c9fe475062189d5a736bee8314;hpb=67c296a2d728a49ac5c587b816dab1c895c149e5;p=binutils-gdb.git diff --git a/gdb/completer.c b/gdb/completer.c index 02e95110114..3ba481ee52c 100644 --- a/gdb/completer.c +++ b/gdb/completer.c @@ -1,5 +1,6 @@ /* Line completion stuff for GDB, the GNU debugger. - Copyright (C) 2000, 2001, 2007, 2008, 2009 Free Software Foundation, Inc. + Copyright (C) 2000, 2001, 2007, 2008, 2009, 2010 + Free Software Foundation, Inc. This file is part of GDB. @@ -78,10 +79,6 @@ static char *gdb_completer_file_name_break_characters = " \t\n*|\"';?><@"; static char *gdb_completer_file_name_break_characters = " \t\n*|\"';:?><"; #endif -/* These are used when completing on locations, which can mix file - names and symbol names separated by a colon. */ -static char *gdb_completer_loc_break_characters = " \t\n*|\"';:?><,"; - /* Characters that can be used to quote completion strings. Note that we can't include '"' because the gdb C parser treats such quoted sequences as strings. */ @@ -129,6 +126,7 @@ filename_completer (struct cmd_list_element *ignore, char *text, char *word) while (1) { char *p, *q; + p = rl_filename_completion_function (text, subsequent_name); if (return_val_used >= return_val_alloced) { @@ -392,6 +390,7 @@ add_struct_fields (struct type *type, int *nextp, char **output, for (i = TYPE_NFN_FIELDS (type) - 1; i >= 0; --i) { char *name = TYPE_FN_FIELDLIST_NAME (type, i); + if (name && ! strncmp (name, fieldname, namelen)) { if (!computed_type_name) @@ -400,7 +399,7 @@ add_struct_fields (struct type *type, int *nextp, char **output, computed_type_name = 1; } /* Omit constructors from the completion list. */ - if (type_name && strcmp (type_name, name)) + if (!type_name || strcmp (type_name, name)) { output[*nextp] = xstrdup (name); ++*nextp; @@ -676,7 +675,7 @@ complete_line_internal (const char *text, char *line_buffer, int point, p--) ; } - if (reason != handle_brkchars) + if (reason != handle_brkchars && c->completer != NULL) list = (*c->completer) (c, p, word); } } @@ -747,7 +746,7 @@ complete_line_internal (const char *text, char *line_buffer, int point, p--) ; } - if (reason != handle_brkchars) + if (reason != handle_brkchars && c->completer != NULL) list = (*c->completer) (c, p, word); } } @@ -786,7 +785,8 @@ command_completer (struct cmd_list_element *ignore, char *text, char *word) char * gdb_completion_word_break_characters (void) { - char ** list; + char **list; + list = complete_line_internal (rl_line_buffer, rl_line_buffer, rl_point, handle_brkchars); gdb_assert (list == NULL);