diff options
-rw-r--r-- | gdb/ChangeLog | 37 | ||||
-rw-r--r-- | gdb/ada-lang.c | 14 | ||||
-rw-r--r-- | gdb/c-lang.c | 4 | ||||
-rw-r--r-- | gdb/completer.c | 12 | ||||
-rw-r--r-- | gdb/d-lang.c | 1 | ||||
-rw-r--r-- | gdb/f-lang.c | 49 | ||||
-rw-r--r-- | gdb/go-lang.c | 1 | ||||
-rw-r--r-- | gdb/language.c | 2 | ||||
-rw-r--r-- | gdb/language.h | 15 | ||||
-rw-r--r-- | gdb/m2-lang.c | 1 | ||||
-rw-r--r-- | gdb/objc-lang.c | 1 | ||||
-rw-r--r-- | gdb/opencl-lang.c | 1 | ||||
-rw-r--r-- | gdb/p-lang.c | 1 | ||||
-rw-r--r-- | gdb/rust-lang.c | 1 |
14 files changed, 83 insertions, 57 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 0cb660f..18c608b 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,5 +1,42 @@ 2020-06-17 Andrew Burgess <andrew.burgess@embecosm.com> + * ada-lang.c (ada_get_gdb_completer_word_break_characters): Delete. + (ada_language_data): Delete la_word_break_characters initializer. + (ada_language::word_break_characters): New member function. + * c-lang.c (c_language_data): Delete la_word_break_characters + initializer. + (cplus_language_data): Likewise. + (asm_language_data): Likewise. + (minimal_language_data): Likewise. + * completer.c: Update global comment. + (advance_to_expression_complete_word_point): Update call to + word_break_characters. + (complete_files_symbols): Likewise. + (complete_line_internal_1): Likewise. + (default_completer_handle_brkchars): Likewise. + (skip_quoted_chars): Likewise. + * d-lang.c (d_language_data): Delete la_word_break_characters + initializer. + * f-lang.c (f_word_break_characters): Delete. + (f_language_data): Delete la_word_break_characters initializer. + (f_language::word_break_characters): New member function. + * go-lang.c (go_language_data): Delete la_word_break_characters + initializer. + * language.c (unknown_language_data): Likewise. + (auto_language_data): Likewise. + * language.h (default_word_break_characters): Move declaration to + earlier in the file. + (language_data): Delete la_word_break_characters field. + (language_defn::word_break_characters): New member function. + * m2-lang.c (m2_language_data): Delete la_word_break_characters + initializer. + * objc-lang.c (objc_language_data): Likewise. + * opencl-lang.c (opencl_language_data): Likewise. + * p-lang.c (pascal_language_data): Likewise. + * rust-lang.c (rust_language_data): Likewise. + +2020-06-17 Andrew Burgess <andrew.burgess@embecosm.com> + * ada-lang.c (ada_get_symbol_name_matcher): Update header comment. (ada_language_data): Delete la_get_symbol_name_matcher initializer. diff --git a/gdb/ada-lang.c b/gdb/ada-lang.c index c91597e..137f4a9 100644 --- a/gdb/ada-lang.c +++ b/gdb/ada-lang.c @@ -488,12 +488,6 @@ add_angle_brackets (const char *str) return string_printf ("<%s>", str); } -static const char * -ada_get_gdb_completer_word_break_characters (void) -{ - return ada_completer_word_break_characters; -} - /* la_watch_location_expression for Ada. */ static gdb::unique_xmalloc_ptr<char> @@ -13917,7 +13911,6 @@ extern const struct language_data ada_language_data = ada_op_print_tab, /* expression operators for printing */ 0, /* c-style arrays */ 1, /* String lower bound */ - ada_get_gdb_completer_word_break_characters, ada_collect_symbol_completion_matches, ada_watch_location_expression, &ada_varobj_ops, @@ -14105,6 +14098,13 @@ public: ada_print_type (type, varstring, stream, show, level, flags); } + /* See language.h. */ + + const char *word_break_characters (void) const override + { + return ada_completer_word_break_characters; + } + protected: /* See language.h. */ diff --git a/gdb/c-lang.c b/gdb/c-lang.c index 8edab07..79c4839 100644 --- a/gdb/c-lang.c +++ b/gdb/c-lang.c @@ -914,7 +914,6 @@ extern const struct language_data c_language_data = c_op_print_tab, /* expression operators for printing */ 1, /* c-style arrays */ 0, /* String lower bound */ - default_word_break_characters, default_collect_symbol_completion_matches, c_watch_location_expression, &c_varobj_ops, @@ -1028,7 +1027,6 @@ extern const struct language_data cplus_language_data = c_op_print_tab, /* expression operators for printing */ 1, /* c-style arrays */ 0, /* String lower bound */ - default_word_break_characters, default_collect_symbol_completion_matches, c_watch_location_expression, &cplus_varobj_ops, @@ -1230,7 +1228,6 @@ extern const struct language_data asm_language_data = c_op_print_tab, /* expression operators for printing */ 1, /* c-style arrays */ 0, /* String lower bound */ - default_word_break_characters, default_collect_symbol_completion_matches, c_watch_location_expression, &default_varobj_ops, @@ -1299,7 +1296,6 @@ extern const struct language_data minimal_language_data = c_op_print_tab, /* expression operators for printing */ 1, /* c-style arrays */ 0, /* String lower bound */ - default_word_break_characters, default_collect_symbol_completion_matches, c_watch_location_expression, &default_varobj_ops, diff --git a/gdb/completer.c b/gdb/completer.c index 1ec0a0e..ea07096 100644 --- a/gdb/completer.c +++ b/gdb/completer.c @@ -155,7 +155,7 @@ enum explicit_location_match_type but it does affect how much stuff M-? lists. (2) If one of the matches contains a word break character, readline will quote it. That's why we switch between - current_language->la_word_break_characters() and + current_language->word_break_characters () and gdb_completer_command_word_break_characters. I'm not sure when we need this behavior (perhaps for funky characters in C++ symbols?). */ @@ -448,7 +448,7 @@ const char * advance_to_expression_complete_word_point (completion_tracker &tracker, const char *text) { - const char *brk_chars = current_language->la_word_break_characters (); + const char *brk_chars = current_language->word_break_characters (); return advance_to_completion_word (tracker, brk_chars, text); } @@ -573,7 +573,7 @@ complete_files_symbols (completion_tracker &tracker, colon = p; symbol_start = p + 1; } - else if (strchr (current_language->la_word_break_characters(), *p)) + else if (strchr (current_language->word_break_characters (), *p)) symbol_start = p + 1; } @@ -1348,7 +1348,7 @@ complete_line_internal_1 (completion_tracker &tracker, strings, which leaves out the '-' and '.' character used in some commands. */ set_rl_completer_word_break_characters - (current_language->la_word_break_characters()); + (current_language->word_break_characters ()); /* Decide whether to complete on a list of gdb commands or on symbols. */ @@ -1964,7 +1964,7 @@ default_completer_handle_brkchars (struct cmd_list_element *ignore, const char *text, const char *word) { set_rl_completer_word_break_characters - (current_language->la_word_break_characters ()); + (current_language->word_break_characters ()); } /* See definition in completer.h. */ @@ -2473,7 +2473,7 @@ skip_quoted_chars (const char *str, const char *quotechars, quotechars = gdb_completer_quote_characters; if (breakchars == NULL) - breakchars = current_language->la_word_break_characters(); + breakchars = current_language->word_break_characters (); for (scan = str; *scan != '\0'; scan++) { diff --git a/gdb/d-lang.c b/gdb/d-lang.c index 4842d4b..56feda1 100644 --- a/gdb/d-lang.c +++ b/gdb/d-lang.c @@ -157,7 +157,6 @@ extern const struct language_data d_language_data = d_op_print_tab, /* Expression operators for printing. */ 1, /* C-style arrays. */ 0, /* String lower bound. */ - default_word_break_characters, default_collect_symbol_completion_matches, c_watch_location_expression, &default_varobj_ops, diff --git a/gdb/f-lang.c b/gdb/f-lang.c index 42e6c98..27495cf 100644 --- a/gdb/f-lang.c +++ b/gdb/f-lang.c @@ -165,30 +165,6 @@ enum f_primitive_types { nr_f_primitive_types }; -/* Remove the modules separator :: from the default break list. */ - -static const char * -f_word_break_characters (void) -{ - static char *retval; - - if (!retval) - { - char *s; - - retval = xstrdup (default_word_break_characters ()); - s = strchr (retval, ':'); - if (s) - { - char *last_char = &s[strlen (s) - 1]; - - *s = *last_char; - *last_char = 0; - } - } - return retval; -} - /* Consider the modules separator :: as a valid symbol name character class. */ @@ -617,7 +593,6 @@ extern const struct language_data f_language_data = f_op_print_tab, /* expression operators for printing */ 0, /* arrays are first-class (not c-style) */ 1, /* String lower bound */ - f_word_break_characters, f_collect_symbol_completion_matches, c_watch_location_expression, &default_varobj_ops, @@ -699,6 +674,30 @@ public: f_print_type (type, varstring, stream, show, level, flags); } + /* See language.h. This just returns default set of word break + characters but with the modules separator `::' removed. */ + + const char *word_break_characters (void) const override + { + static char *retval; + + if (!retval) + { + char *s; + + retval = xstrdup (language_defn::word_break_characters ()); + s = strchr (retval, ':'); + if (s) + { + char *last_char = &s[strlen (s) - 1]; + + *s = *last_char; + *last_char = 0; + } + } + return retval; + } + protected: /* See language.h. */ diff --git a/gdb/go-lang.c b/gdb/go-lang.c index 661cabb..1b3372a 100644 --- a/gdb/go-lang.c +++ b/gdb/go-lang.c @@ -542,7 +542,6 @@ extern const struct language_data go_language_data = go_op_print_tab, /* Expression operators for printing. */ 1, /* C-style arrays. */ 0, /* String lower bound. */ - default_word_break_characters, default_collect_symbol_completion_matches, c_watch_location_expression, &default_varobj_ops, diff --git a/gdb/language.c b/gdb/language.c index 363481b..167a68c 100644 --- a/gdb/language.c +++ b/gdb/language.c @@ -779,7 +779,6 @@ extern const struct language_data unknown_language_data = unk_op_print_tab, /* expression operators for printing */ 1, /* c-style arrays */ 0, /* String lower bound */ - default_word_break_characters, default_collect_symbol_completion_matches, c_watch_location_expression, &default_varobj_ops, @@ -852,7 +851,6 @@ extern const struct language_data auto_language_data = unk_op_print_tab, /* expression operators for printing */ 1, /* c-style arrays */ 0, /* String lower bound */ - default_word_break_characters, default_collect_symbol_completion_matches, c_watch_location_expression, &default_varobj_ops, diff --git a/gdb/language.h b/gdb/language.h index 7e5837f..8c6f7e3 100644 --- a/gdb/language.h +++ b/gdb/language.h @@ -169,6 +169,9 @@ struct language_pass_by_ref_info bool destructible = true; }; +/* Splitting strings into words. */ +extern const char *default_word_break_characters (void); + /* Structure tying together assorted information about a language. As we move over from the old structure based languages to a class @@ -316,9 +319,6 @@ struct language_data /* Index to use for extracting the first element of a string. */ char string_lower_bound; - /* The list of characters forming word boundaries. */ - const char *(*la_word_break_characters) (void); - /* Add to the completion tracker all symbols which are possible completions for TEXT. WORD is the entire command on which the completion is being made. If CODE is TYPE_CODE_UNDEF, then all @@ -529,6 +529,12 @@ struct language_defn : language_data return nullptr; } + /* The list of characters forming word boundaries. */ + virtual const char *word_break_characters (void) const + { + return default_word_break_characters (); + } + /* List of all known languages. */ static const struct language_defn *languages[nr_languages]; @@ -691,9 +697,6 @@ extern CORE_ADDR skip_language_trampoline (struct frame_info *, CORE_ADDR pc); extern char *language_demangle (const struct language_defn *current_language, const char *mangled, int options); -/* Splitting strings into words. */ -extern const char *default_word_break_characters (void); - /* Return information about whether TYPE should be passed (and returned) by reference at the language level. */ struct language_pass_by_ref_info language_pass_by_reference (struct type *type); diff --git a/gdb/m2-lang.c b/gdb/m2-lang.c index 9245ebb..331ad5a 100644 --- a/gdb/m2-lang.c +++ b/gdb/m2-lang.c @@ -376,7 +376,6 @@ extern const struct language_data m2_language_data = m2_op_print_tab, /* expression operators for printing */ 0, /* arrays are first-class (not c-style) */ 0, /* String lower bound */ - default_word_break_characters, default_collect_symbol_completion_matches, c_watch_location_expression, &default_varobj_ops, diff --git a/gdb/objc-lang.c b/gdb/objc-lang.c index 9a77f6c..3bd7189 100644 --- a/gdb/objc-lang.c +++ b/gdb/objc-lang.c @@ -351,7 +351,6 @@ extern const struct language_data objc_language_data = objc_op_print_tab, /* Expression operators for printing */ 1, /* C-style arrays */ 0, /* String lower bound */ - default_word_break_characters, default_collect_symbol_completion_matches, c_watch_location_expression, &default_varobj_ops, diff --git a/gdb/opencl-lang.c b/gdb/opencl-lang.c index 377c550..3f0fb1f 100644 --- a/gdb/opencl-lang.c +++ b/gdb/opencl-lang.c @@ -1030,7 +1030,6 @@ extern const struct language_data opencl_language_data = c_op_print_tab, /* expression operators for printing */ 1, /* c-style arrays */ 0, /* String lower bound */ - default_word_break_characters, default_collect_symbol_completion_matches, c_watch_location_expression, &default_varobj_ops, diff --git a/gdb/p-lang.c b/gdb/p-lang.c index 189617a..22ed912 100644 --- a/gdb/p-lang.c +++ b/gdb/p-lang.c @@ -407,7 +407,6 @@ extern const struct language_data pascal_language_data = pascal_op_print_tab, /* expression operators for printing */ 1, /* c-style arrays */ 0, /* String lower bound */ - default_word_break_characters, default_collect_symbol_completion_matches, c_watch_location_expression, &default_varobj_ops, diff --git a/gdb/rust-lang.c b/gdb/rust-lang.c index 3f187bd..53d1ee2 100644 --- a/gdb/rust-lang.c +++ b/gdb/rust-lang.c @@ -2062,7 +2062,6 @@ extern const struct language_data rust_language_data = c_op_print_tab, /* expression operators for printing */ 1, /* c-style arrays */ 0, /* String lower bound */ - default_word_break_characters, default_collect_symbol_completion_matches, rust_watch_location_expression, &default_varobj_ops, |