aboutsummaryrefslogtreecommitdiff
path: root/gdb/c-lang.c
diff options
context:
space:
mode:
authorAndrew Burgess <andrew.burgess@embecosm.com>2020-07-12 10:15:32 +0100
committerAndrew Burgess <andrew.burgess@embecosm.com>2020-09-16 11:01:24 +0100
commitefdf6a733d2a59a1a07ec61e848fa9e128259fe3 (patch)
tree896cf4b18a264b7128c28eaf84d4a694fc5eea01 /gdb/c-lang.c
parentbf92aec5884b64a73a334aea875c68e8d1f959fc (diff)
downloadgdb-efdf6a733d2a59a1a07ec61e848fa9e128259fe3.zip
gdb-efdf6a733d2a59a1a07ec61e848fa9e128259fe3.tar.gz
gdb-efdf6a733d2a59a1a07ec61e848fa9e128259fe3.tar.bz2
gdb: Convert language_data::la_range_check to a method
Convert language_data::la_range_check member variable to a virtual method language_defn::range_checking_on_by_default. Where the previous member variable was of type 'enum range_check', the new member function returns a boolean that selects between range checking being on or off. This removes the possibility of a language having its default be the third enum state, range_check_warn, which no language currently used. This all makes sense I think, the language's true/false provides the default when the global 'set check range' is set to 'auto'. There should be no user visible changes after this commit. gdb/ChangeLog: * ada-lang.c (ada_language_data): Remove la_range_check 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. (f_language::range_checking_on_by_default): New member function. * go-lang.c (go_language_data): Remove la_range_check initializer. * language.c (enum range_mode): Moved here from language.h. (range_mode): Made static. (show_range_command): Update to use range_checking_on_by_default. (set_range_command): Likewise. (set_range_case): Likewise. (unknown_language_data): Remove la_range_check initializer. (auto_language_data): Likewise. * language.h (range_mode): Delete. Enum definition moved to language.c. (language_data): Remove la_range_check field. (language_defn::range_checking_on_by_default): New member function. * m2-lang.c (m2_language_data): Remove la_range_check initializer. (m2_language::range_checking_on_by_default): New member function. * objc-lang.c (objc_language_data): Remove la_range_check initializer. * opencl-lang.c (opencl_language_data): Likewise. * p-lang.c (pascal_language_data): Likewise. (pascal_language::range_checking_on_by_default): New member function. * rust-lang.c (rust_language_data): Remove la_range_check initializer. (rust_language::range_checking_on_by_default): New member function.
Diffstat (limited to 'gdb/c-lang.c')
-rw-r--r--gdb/c-lang.c4
1 files changed, 0 insertions, 4 deletions
diff --git a/gdb/c-lang.c b/gdb/c-lang.c
index c8fe630..88af458 100644
--- a/gdb/c-lang.c
+++ b/gdb/c-lang.c
@@ -875,7 +875,6 @@ const struct exp_descriptor exp_descriptor_c =
extern const struct language_data c_language_data =
{
- range_check_off,
case_sensitive_on,
array_row_major,
macro_expansion_c,
@@ -985,7 +984,6 @@ enum cplus_primitive_types {
extern const struct language_data cplus_language_data =
{
- range_check_off,
case_sensitive_on,
array_row_major,
macro_expansion_c,
@@ -1193,7 +1191,6 @@ static cplus_language cplus_language_defn;
extern const struct language_data asm_language_data =
{
- range_check_off,
case_sensitive_on,
array_row_major,
macro_expansion_c,
@@ -1264,7 +1261,6 @@ static asm_language asm_language_defn;
extern const struct language_data minimal_language_data =
{
- range_check_off,
case_sensitive_on,
array_row_major,
macro_expansion_c,