diff options
author | Andrew Burgess <andrew.burgess@embecosm.com> | 2020-07-12 15:09:52 +0100 |
---|---|---|
committer | Andrew Burgess <andrew.burgess@embecosm.com> | 2020-09-16 11:04:03 +0100 |
commit | 0d201fa46059ddd27980ccf8cca8488ac98b89be (patch) | |
tree | 3bbb11e9ef64b1a8a6781aed8f094a8f07286a9f /gdb/language.h | |
parent | efdf6a733d2a59a1a07ec61e848fa9e128259fe3 (diff) | |
download | gdb-0d201fa46059ddd27980ccf8cca8488ac98b89be.zip gdb-0d201fa46059ddd27980ccf8cca8488ac98b89be.tar.gz gdb-0d201fa46059ddd27980ccf8cca8488ac98b89be.tar.bz2 |
gdb: Convert language_data::la_case_sensitivity to a method
Convert language_data::la_case_sensitivity member variable to a virtual
method language_defn::case_sensitivity.
This is mostly straight forward. The only slight problem is that I
ended up deleting this comment from ada-lang.c:
/* Yes, Ada is case-insensitive, but that's not quite what this
means. */
However, as the comment (which has existed since Ada support was first
added to GDB) doesn't explain _why_ Ada sets case sensitivity to on
despite being a generally case insensitive language, this doesn't
really help me much.
If I understood _why_ the setting doesn't quite mean what it seems to
mean (at least as far as Ada is concerned) then I would extend the
comment on language_defn::case_sensitivity (in language.h) to include
the detail, and note how this impacts Ada. But as it stands I've just
deleted the comment for now.
There should be no user visible changes after this commit.
gdb/ChangeLog:
* ada-lang.c (ada_language_data): Remove la_case_sensitivity
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::case_sensitivity): New member function.
* go-lang.c (go_language_data): Remove la_case_sensitivity
initializer.
* language.c (enum case_mode): Moved here from language.h.
(case_mode): Make static.
(show_case_command): Update for case_sensitivity being a method.
(set_case_command): Likewise.
(set_range_case): Likewise.
(unknown_language_data): Remove la_case_sensitivity initializer.
(auto_language_data): Likewise.
* language.h (case_mode): Delete, move enum declaration to
language.c.
(language_data): Delete la_case_sensitivity field.
(language_defn::case_sensitivity): New member function.
* m2-lang.c (m2_language_data): Remove la_case_sensitivity
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.
Diffstat (limited to 'gdb/language.h')
-rw-r--r-- | gdb/language.h | 20 |
1 files changed, 7 insertions, 13 deletions
diff --git a/gdb/language.h b/gdb/language.h index ffdcdbc..b6d1d15 100644 --- a/gdb/language.h +++ b/gdb/language.h @@ -53,16 +53,6 @@ extern enum range_check } range_check; -/* case_mode == - case_mode_auto: case_sensitivity set upon selection of scope. - case_mode_manual: case_sensitivity set only by user. */ - -extern enum case_mode - { - case_mode_auto, case_mode_manual - } -case_mode; - /* array_ordering == array_row_major: Arrays are in row major order. array_column_major: Arrays are in column major order. */ @@ -178,9 +168,6 @@ extern const char *default_word_break_characters (void); struct language_data { - /* Default case sensitivity. */ - enum case_sensitivity la_case_sensitivity; - /* Multi-dimensional array ordering. */ enum array_ordering la_array_ordering; @@ -565,6 +552,13 @@ struct language_defn : language_data virtual bool range_checking_on_by_default () const { return false; } + /* Is this language case sensitive? The return value from this function + provides the automativ setting for 'set case-sensitive', as a + consequence, a user is free to override this setting if they want. */ + + virtual enum case_sensitivity case_sensitivity () const + { return case_sensitive_on; } + protected: /* This is the overridable part of the GET_SYMBOL_NAME_MATCHER method. |