aboutsummaryrefslogtreecommitdiff
path: root/gdb/p-lang.c
diff options
context:
space:
mode:
authorAndrew Burgess <andrew.burgess@embecosm.com>2020-07-05 09:29:34 +0100
committerAndrew Burgess <andrew.burgess@embecosm.com>2020-09-16 10:16:48 +0100
commit22c12a6c70a0bf1c292478436f12df0a2d84c2a2 (patch)
treeeb8f23e76fedac0151280623ebe9d055819b34d3 /gdb/p-lang.c
parent1c236ddd45b182b6f4895b276183cdd8382d3e1b (diff)
downloadgdb-22c12a6c70a0bf1c292478436f12df0a2d84c2a2.zip
gdb-22c12a6c70a0bf1c292478436f12df0a2d84c2a2.tar.gz
gdb-22c12a6c70a0bf1c292478436f12df0a2d84c2a2.tar.bz2
gdb: Convert language_data::string_lower_bound to a method
Convert language_data::string_lower_bound member variable to a virtual method language_defn::string_lower_bound. Over all of the languages we currently support there are currently only two values for the lower bound, 0 or 1. I noticed that in all cases, if a language has C style arrays then the lower bound is 0, otherwise the lower bound is 1. So the default for the virtual method in language.h makes use of this, which means languages don't have to worry about providing a string_lower_bound method at all. Except for Modula2. This language is defined to not have C style arrays, but has a string_lower_bound index of 0, this behaviour is maintained after this commit by having Modula2 be the only language that overrides the string_lower_bound method. There should be no user visible changes after this commit. gdb/ChangeLog: * ada-lang.c (ada_language_data): Remove string_lower_bound initializer. * c-lang.c (c_language_data): Likewise. (cplus_language_data): Likewise. (asm_language_data): Likewise. (minimal_language_data): Likewise. * d-lang.c (d_language_data): Likewise. * f-lang.c (f_language_data): Likewise. * go-lang.c (go_language_data): Likewise. * language.c (unknown_language_data): Likewise. (auto_language_data): Likewise. * language.h (language_data): Remove string_lower_bound field. (language_defn::string_lower_bound): New member function. * m2-lang.c (m2_language_data): Remove string_lower_bound initializer. (m2_language::string_lower_bound): New member function. * objc-lang.c (objc_language_data): Remove string_lower_bound initializer. * opencl-lang.c (opencl_language_data): Likewise. * p-lang.c (pascal_language_data): Likewise. * rust-lang.c (rust_language_data): Likewise. * valops.c (value_cstring): Update call to string_lower_bound. (value_string): Likewise. * value.c (allocate_repeated_value): Likewise.
Diffstat (limited to 'gdb/p-lang.c')
-rw-r--r--gdb/p-lang.c1
1 files changed, 0 insertions, 1 deletions
diff --git a/gdb/p-lang.c b/gdb/p-lang.c
index 66ba51a..b075571 100644
--- a/gdb/p-lang.c
+++ b/gdb/p-lang.c
@@ -259,7 +259,6 @@ extern const struct language_data pascal_language_data =
&exp_descriptor_standard,
false, /* la_store_sym_names_in_linkage_form_p */
pascal_op_print_tab, /* expression operators for printing */
- 0, /* String lower bound */
&default_varobj_ops,
};