gdb: Convert la_struct_too_deep_ellipsis to a method

Convert language_data::la_struct_too_deep_ellipsis member variable to
a method in language_defn.

There should be no user visible changes after this commit.

gdb/ChangeLog:

	* ada-lang.c (ada_language_data): Remove
	la_struct_too_deep_ellipsis initializer.
	(ada_language::struct_too_deep_ellipsis): New member function.
	* c-lang.c (c_language_data): Remove la_struct_too_deep_ellipsis
	initializer.
	(cplus_language_data): Likewise.
	(asm_language_data): Likewise.
	(minimal_language_data): Likewise.
	* cp-valprint.c (cp_print_value): Update call to
	struct_too_deep_ellipsis.
	* d-lang.c (d_language_data): Remove la_struct_too_deep_ellipsis
	initializer.
	* f-lang.c (f_language_data): Likewise.
	(f_language::struct_too_deep_ellipsis): New member function.
	* go-lang.c (go_language_data): Remove la_struct_too_deep_ellipsis
	initializer.
	* language.c (unknown_language_data): Likewise.
	(auto_language_data): Likewise.
	* language.h (language_data): Delete la_struct_too_deep_ellipsis
	member variable.
	(language_defn::struct_too_deep_ellipsis): New member function.
	* m2-lang.c (m2_language_data): Remove la_struct_too_deep_ellipsis
	initializer.Q
	* 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.
	* valprint.c (val_print_check_max_depth): Update call to
	struct_too_deep_ellipsis.
This commit is contained in:
Andrew Burgess
2020-06-23 14:16:32 +01:00
parent ed29e1c7e0
commit 22e3f3ed5c
15 changed files with 55 additions and 25 deletions

View File

@ -266,12 +266,6 @@ struct language_data
/* Various operations on varobj. */
const struct lang_varobj_ops *la_varobj_ops;
/* This string is used by the 'set print max-depth' setting. When GDB
replaces a struct or union (during value printing) that is "too
deep" this string is displayed instead. */
const char *la_struct_too_deep_ellipsis;
};
/* Base class from which all other language classes derive. */
@ -553,6 +547,16 @@ struct language_defn : language_data
/* Return true if TYPE is a string type. */
virtual bool is_string_type_p (struct type *type) const;
/* Return a string that is used by the 'set print max-depth' setting.
When GDB replaces a struct or union (during value printing) that is
"too deep" this string is displayed instead. The default value here
suits most languages. If overriding then the string here should
ideally be similar in style to the default; an opener, three '.', and
a closer. */
virtual const char *struct_too_deep_ellipsis () const
{ return "{...}"; }
protected:
/* This is the overridable part of the GET_SYMBOL_NAME_MATCHER method.