aboutsummaryrefslogtreecommitdiff
path: root/gdb/language.h
diff options
context:
space:
mode:
authorAndrew Burgess <andrew.burgess@embecosm.com>2020-06-03 16:44:05 +0100
committerAndrew Burgess <andrew.burgess@embecosm.com>2020-06-23 13:34:11 +0100
commitd711ee67aca06c9753f09dc154eb8c75cb4f58ef (patch)
tree3eb445d93e521604f3e07adadf2eba3ceac068f6 /gdb/language.h
parent52b50f2c1b1eaf6fd6e685e2c9575f92c581a6dc (diff)
downloadfsf-binutils-gdb-d711ee67aca06c9753f09dc154eb8c75cb4f58ef.zip
fsf-binutils-gdb-d711ee67aca06c9753f09dc154eb8c75cb4f58ef.tar.gz
fsf-binutils-gdb-d711ee67aca06c9753f09dc154eb8c75cb4f58ef.tar.bz2
gdb: Convert language la_printstr field to a method
This commit changes the language_data::la_printstr function pointer member variable into a member function of language_defn. There should be no user visible changes after this commit. gdb/ChangeLog: * ada-lang.c (ada_language_data): Delete la_printstr initializer. (ada_language::printstr): New member function. * c-lang.c (c_language_data): Delete la_printstr initializer. (cplus_language_data): Likewise. (asm_language_data): Likewise. (minimal_language_data): Likewise. * d-lang.c (d_language_data): Likewise. * f-lang.c (f_printstr): Rename to f_language::printstr. (f_language_data): Delete la_printstr initializer. (f_language::printstr): New member function, implementation from f_printstr. * go-lang.c (go_language_data): Delete la_printstr initializer. * language.c (language_defn::printstr): Define new member function. (unk_lang_printstr): Delete. (unknown_language_data): Delete la_printstr initializer. (unknown_language::printstr): New member function. (auto_language_data): Delete la_printstr initializer. (auto_language::printstr): New member function. * language.h (language_data): Delete la_printstr field. (language_defn::printstr): Declare new member function. (LA_PRINT_STRING): Update call to printstr. * m2-lang.c (m2_printstr): Rename to m2_language::printstr. (m2_language_data): Delete la_printstr initializer. (m2_language::printstr): New member function, implementation from m2_printstr. * objc-lang.c (objc_language_data): Delete la_printstr initializer. * opencl-lang.c (opencl_language_data): Likewise. * p-lang.c (pascal_printstr): Rename to pascal_language::printstr. (pascal_language_data): Delete la_printstr initializer. (pascal_language::printstr): New member function, implementation from pascal_printstr. * p-lang.h (pascal_printstr): Delete declaration. * rust-lang.c (rust_printstr): Update header comment. (rust_language_data): Delete la_printstr initializer. (rust_language::printstr): New member function.
Diffstat (limited to 'gdb/language.h')
-rw-r--r--gdb/language.h19
1 files changed, 12 insertions, 7 deletions
diff --git a/gdb/language.h b/gdb/language.h
index fc9efd8..a68b6df 100644
--- a/gdb/language.h
+++ b/gdb/language.h
@@ -225,11 +225,6 @@ struct language_data
const struct exp_descriptor *la_exp_desc;
- void (*la_printstr) (struct ui_file * stream, struct type *elttype,
- const gdb_byte *string, unsigned int length,
- const char *encoding, int force_ellipses,
- const struct value_print_options *);
-
/* Print a typedef using syntax appropriate for this language.
TYPE is the underlying type. NEW_SYMBOL is the symbol naming
the type. STREAM is the output stream on which to print. */
@@ -547,6 +542,16 @@ struct language_defn : language_data
virtual void printchar (int ch, struct type *chtype,
struct ui_file * stream) const;
+/* Print the character string STRING, printing at most LENGTH characters.
+ Printing stops early if the number hits print_max; repeat counts
+ are printed as appropriate. Print ellipses at the end if we
+ had to stop before printing LENGTH characters, or if FORCE_ELLIPSES. */
+
+ virtual void printstr (struct ui_file *stream, struct type *elttype,
+ const gdb_byte *string, unsigned int length,
+ const char *encoding, int force_ellipses,
+ const struct value_print_options *options) const;
+
protected:
/* This is the overridable part of the GET_SYMBOL_NAME_MATCHER method.
@@ -651,8 +656,8 @@ extern enum language set_language (enum language);
#define LA_PRINT_CHAR(ch, type, stream) \
(current_language->printchar (ch, type, stream))
#define LA_PRINT_STRING(stream, elttype, string, length, encoding, force_ellipses, options) \
- (current_language->la_printstr(stream, elttype, string, length, \
- encoding, force_ellipses,options))
+ (current_language->printstr (stream, elttype, string, length, \
+ encoding, force_ellipses,options))
#define LA_EMIT_CHAR(ch, type, stream, quoter) \
(current_language->emitchar (ch, type, stream, quoter))