summaryrefslogtreecommitdiff
path: root/gdb/c-typeprint.c
diff options
context:
space:
mode:
authorTom Tromey <tromey@redhat.com>2012-11-12 17:26:18 +0000
committerTom Tromey <tromey@redhat.com>2012-11-12 17:26:18 +0000
commit9fd6ecf117ad3235e06d154941f15aa037a0c21d (patch)
tree00eb4c31f8d7b1e98b2f07cac531d428424d26e7 /gdb/c-typeprint.c
parentcb8444995ae08213f95344a774cf1f6dfbdba56a (diff)
downloadgdb-9fd6ecf117ad3235e06d154941f15aa037a0c21d.tar.gz
* NEWS: Update.
* c-typeprint.c (c_type_print_base): Handle print_method and print_typedefs flags. * gdbcmd.h (setprinttypelist, showprinttypelist): Declare. * python/py-type.c (typy_str): Use LA_PRINT_TYPE and raw options. * typeprint.c (type_print_raw_options, default_ptype_flags): Update for new field.s (whatis_exp): Parse flags. Use LA_PRINT_TYPE. (setprinttypelist, showprinttypelist, print_methods, print_typedefs): New globals. (set_print_type, show_print_type, set_print_type_methods, show_print_type_methods, set_print_type_typedefs, show_print_type_typedefs): New functions. (_initialize_typeprint): Update documentation. Add "print type methods" and "print type typedefs" parameters. * typeprint.h (struct type_print_options) <print_methods, print_typedefs>: New fields. doc * gdb.texinfo (Symbols): Document "set print type methods", "set print type typedefs", and flags to ptype and whatis.
Diffstat (limited to 'gdb/c-typeprint.c')
-rw-r--r--gdb/c-typeprint.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/gdb/c-typeprint.c b/gdb/c-typeprint.c
index cb44bb08695..6c4737657df 100644
--- a/gdb/c-typeprint.c
+++ b/gdb/c-typeprint.c
@@ -970,6 +970,8 @@ c_type_print_base (struct type *type, struct ui_file *stream,
between them. Make sure to count only method that we
will display; artificial methods will be hidden. */
len = TYPE_NFN_FIELDS (type);
+ if (!flags->print_methods)
+ len = 0;
real_len = 0;
for (i = 0; i < len; i++)
{
@@ -1136,7 +1138,7 @@ c_type_print_base (struct type *type, struct ui_file *stream,
/* Print typedefs defined in this class. */
- if (TYPE_TYPEDEF_FIELD_COUNT (type) != 0)
+ if (TYPE_TYPEDEF_FIELD_COUNT (type) != 0 && flags->print_typedefs)
{
if (TYPE_NFIELDS (type) != 0 || TYPE_NFN_FIELDS (type) != 0)
fprintf_filtered (stream, "\n");