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:
parent
ed29e1c7e0
commit
22e3f3ed5c
15 changed files with 55 additions and 25 deletions
|
@ -1,3 +1,35 @@
|
||||||
|
2020-09-16 Andrew Burgess <andrew.burgess@embecosm.com>
|
||||||
|
|
||||||
|
* 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.
|
||||||
|
|
||||||
2020-09-16 Felix Willgerodt <felix.willgerodt@intel.com>
|
2020-09-16 Felix Willgerodt <felix.willgerodt@intel.com>
|
||||||
|
|
||||||
* MAINTAINERS (Write After Approval): Add myself.
|
* MAINTAINERS (Write After Approval): Add myself.
|
||||||
|
|
|
@ -13729,7 +13729,6 @@ extern const struct language_data ada_language_data =
|
||||||
0, /* c-style arrays */
|
0, /* c-style arrays */
|
||||||
1, /* String lower bound */
|
1, /* String lower bound */
|
||||||
&ada_varobj_ops,
|
&ada_varobj_ops,
|
||||||
"(...)" /* la_struct_too_deep_ellipsis */
|
|
||||||
};
|
};
|
||||||
|
|
||||||
/* Class representing the Ada language. */
|
/* Class representing the Ada language. */
|
||||||
|
@ -14187,6 +14186,10 @@ public:
|
||||||
return ada_is_string_type (type);
|
return ada_is_string_type (type);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* See language.h. */
|
||||||
|
|
||||||
|
const char *struct_too_deep_ellipsis () const override
|
||||||
|
{ return "(...)"; }
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
/* See language.h. */
|
/* See language.h. */
|
||||||
|
|
|
@ -895,7 +895,6 @@ extern const struct language_data c_language_data =
|
||||||
1, /* c-style arrays */
|
1, /* c-style arrays */
|
||||||
0, /* String lower bound */
|
0, /* String lower bound */
|
||||||
&c_varobj_ops,
|
&c_varobj_ops,
|
||||||
"{...}" /* la_struct_too_deep_ellipsis */
|
|
||||||
};
|
};
|
||||||
|
|
||||||
/* Class representing the C language. */
|
/* Class representing the C language. */
|
||||||
|
@ -996,7 +995,6 @@ extern const struct language_data cplus_language_data =
|
||||||
1, /* c-style arrays */
|
1, /* c-style arrays */
|
||||||
0, /* String lower bound */
|
0, /* String lower bound */
|
||||||
&cplus_varobj_ops,
|
&cplus_varobj_ops,
|
||||||
"{...}" /* la_struct_too_deep_ellipsis */
|
|
||||||
};
|
};
|
||||||
|
|
||||||
/* A class for the C++ language. */
|
/* A class for the C++ language. */
|
||||||
|
@ -1194,7 +1192,6 @@ extern const struct language_data asm_language_data =
|
||||||
1, /* c-style arrays */
|
1, /* c-style arrays */
|
||||||
0, /* String lower bound */
|
0, /* String lower bound */
|
||||||
&default_varobj_ops,
|
&default_varobj_ops,
|
||||||
"{...}" /* la_struct_too_deep_ellipsis */
|
|
||||||
};
|
};
|
||||||
|
|
||||||
/* A class for the ASM language. */
|
/* A class for the ASM language. */
|
||||||
|
@ -1250,7 +1247,6 @@ extern const struct language_data minimal_language_data =
|
||||||
1, /* c-style arrays */
|
1, /* c-style arrays */
|
||||||
0, /* String lower bound */
|
0, /* String lower bound */
|
||||||
&default_varobj_ops,
|
&default_varobj_ops,
|
||||||
"{...}" /* la_struct_too_deep_ellipsis */
|
|
||||||
};
|
};
|
||||||
|
|
||||||
/* A class for the minimal language. */
|
/* A class for the minimal language. */
|
||||||
|
|
|
@ -499,8 +499,8 @@ cp_print_value (struct value *val, struct ui_file *stream,
|
||||||
&& recurse >= options->max_depth)
|
&& recurse >= options->max_depth)
|
||||||
{
|
{
|
||||||
const struct language_defn *language = current_language;
|
const struct language_defn *language = current_language;
|
||||||
gdb_assert (language->la_struct_too_deep_ellipsis != NULL);
|
gdb_assert (language->struct_too_deep_ellipsis () != NULL);
|
||||||
fputs_filtered (language->la_struct_too_deep_ellipsis, stream);
|
fputs_filtered (language->struct_too_deep_ellipsis (), stream);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
|
@ -148,7 +148,6 @@ extern const struct language_data d_language_data =
|
||||||
1, /* C-style arrays. */
|
1, /* C-style arrays. */
|
||||||
0, /* String lower bound. */
|
0, /* String lower bound. */
|
||||||
&default_varobj_ops,
|
&default_varobj_ops,
|
||||||
"{...}" /* la_struct_too_deep_ellipsis */
|
|
||||||
};
|
};
|
||||||
|
|
||||||
/* Class representing the D language. */
|
/* Class representing the D language. */
|
||||||
|
|
|
@ -508,7 +508,6 @@ extern const struct language_data f_language_data =
|
||||||
0, /* arrays are first-class (not c-style) */
|
0, /* arrays are first-class (not c-style) */
|
||||||
1, /* String lower bound */
|
1, /* String lower bound */
|
||||||
&default_varobj_ops,
|
&default_varobj_ops,
|
||||||
"(...)" /* la_struct_too_deep_ellipsis */
|
|
||||||
};
|
};
|
||||||
|
|
||||||
/* Class representing the Fortran language. */
|
/* Class representing the Fortran language. */
|
||||||
|
@ -707,6 +706,11 @@ public:
|
||||||
&& TYPE_TARGET_TYPE (type)->code () == TYPE_CODE_CHAR));
|
&& TYPE_TARGET_TYPE (type)->code () == TYPE_CODE_CHAR));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* See language.h. */
|
||||||
|
|
||||||
|
const char *struct_too_deep_ellipsis () const override
|
||||||
|
{ return "(...)"; }
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|
||||||
/* See language.h. */
|
/* See language.h. */
|
||||||
|
|
|
@ -523,7 +523,6 @@ extern const struct language_data go_language_data =
|
||||||
1, /* C-style arrays. */
|
1, /* C-style arrays. */
|
||||||
0, /* String lower bound. */
|
0, /* String lower bound. */
|
||||||
&default_varobj_ops,
|
&default_varobj_ops,
|
||||||
"{...}" /* la_struct_too_deep_ellipsis */
|
|
||||||
};
|
};
|
||||||
|
|
||||||
/* Class representing the Go language. */
|
/* Class representing the Go language. */
|
||||||
|
|
|
@ -798,7 +798,6 @@ extern const struct language_data unknown_language_data =
|
||||||
1, /* c-style arrays */
|
1, /* c-style arrays */
|
||||||
0, /* String lower bound */
|
0, /* String lower bound */
|
||||||
&default_varobj_ops,
|
&default_varobj_ops,
|
||||||
"{...}" /* la_struct_too_deep_ellipsis */
|
|
||||||
};
|
};
|
||||||
|
|
||||||
/* Class representing the unknown language. */
|
/* Class representing the unknown language. */
|
||||||
|
@ -924,7 +923,6 @@ extern const struct language_data auto_language_data =
|
||||||
1, /* c-style arrays */
|
1, /* c-style arrays */
|
||||||
0, /* String lower bound */
|
0, /* String lower bound */
|
||||||
&default_varobj_ops,
|
&default_varobj_ops,
|
||||||
"{...}" /* la_struct_too_deep_ellipsis */
|
|
||||||
};
|
};
|
||||||
|
|
||||||
/* Class representing the fake "auto" language. */
|
/* Class representing the fake "auto" language. */
|
||||||
|
|
|
@ -266,12 +266,6 @@ struct language_data
|
||||||
|
|
||||||
/* Various operations on varobj. */
|
/* Various operations on varobj. */
|
||||||
const struct lang_varobj_ops *la_varobj_ops;
|
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. */
|
/* 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. */
|
/* Return true if TYPE is a string type. */
|
||||||
virtual bool is_string_type_p (struct type *type) const;
|
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:
|
protected:
|
||||||
|
|
||||||
/* This is the overridable part of the GET_SYMBOL_NAME_MATCHER method.
|
/* This is the overridable part of the GET_SYMBOL_NAME_MATCHER method.
|
||||||
|
|
|
@ -214,7 +214,6 @@ extern const struct language_data m2_language_data =
|
||||||
0, /* arrays are first-class (not c-style) */
|
0, /* arrays are first-class (not c-style) */
|
||||||
0, /* String lower bound */
|
0, /* String lower bound */
|
||||||
&default_varobj_ops,
|
&default_varobj_ops,
|
||||||
"{...}" /* la_struct_too_deep_ellipsis */
|
|
||||||
};
|
};
|
||||||
|
|
||||||
/* Class representing the M2 language. */
|
/* Class representing the M2 language. */
|
||||||
|
|
|
@ -343,7 +343,6 @@ extern const struct language_data objc_language_data =
|
||||||
1, /* C-style arrays */
|
1, /* C-style arrays */
|
||||||
0, /* String lower bound */
|
0, /* String lower bound */
|
||||||
&default_varobj_ops,
|
&default_varobj_ops,
|
||||||
"{...}" /* la_struct_too_deep_ellipsis */
|
|
||||||
};
|
};
|
||||||
|
|
||||||
/* Class representing the Objective-C language. */
|
/* Class representing the Objective-C language. */
|
||||||
|
|
|
@ -1021,7 +1021,6 @@ extern const struct language_data opencl_language_data =
|
||||||
1, /* c-style arrays */
|
1, /* c-style arrays */
|
||||||
0, /* String lower bound */
|
0, /* String lower bound */
|
||||||
&default_varobj_ops,
|
&default_varobj_ops,
|
||||||
"{...}" /* la_struct_too_deep_ellipsis */
|
|
||||||
};
|
};
|
||||||
|
|
||||||
/* Class representing the OpenCL language. */
|
/* Class representing the OpenCL language. */
|
||||||
|
|
|
@ -272,7 +272,6 @@ extern const struct language_data pascal_language_data =
|
||||||
1, /* c-style arrays */
|
1, /* c-style arrays */
|
||||||
0, /* String lower bound */
|
0, /* String lower bound */
|
||||||
&default_varobj_ops,
|
&default_varobj_ops,
|
||||||
"{...}" /* la_struct_too_deep_ellipsis */
|
|
||||||
};
|
};
|
||||||
|
|
||||||
/* Class representing the Pascal language. */
|
/* Class representing the Pascal language. */
|
||||||
|
|
|
@ -1921,7 +1921,6 @@ extern const struct language_data rust_language_data =
|
||||||
1, /* c-style arrays */
|
1, /* c-style arrays */
|
||||||
0, /* String lower bound */
|
0, /* String lower bound */
|
||||||
&default_varobj_ops,
|
&default_varobj_ops,
|
||||||
"{...}" /* la_struct_too_deep_ellipsis */
|
|
||||||
};
|
};
|
||||||
|
|
||||||
/* Class representing the Rust language. */
|
/* Class representing the Rust language. */
|
||||||
|
|
|
@ -1025,8 +1025,8 @@ val_print_check_max_depth (struct ui_file *stream, int recurse,
|
||||||
{
|
{
|
||||||
if (options->max_depth > -1 && recurse >= options->max_depth)
|
if (options->max_depth > -1 && recurse >= options->max_depth)
|
||||||
{
|
{
|
||||||
gdb_assert (language->la_struct_too_deep_ellipsis != NULL);
|
gdb_assert (language->struct_too_deep_ellipsis () != NULL);
|
||||||
fputs_filtered (language->la_struct_too_deep_ellipsis, stream);
|
fputs_filtered (language->struct_too_deep_ellipsis (), stream);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue