diff options
author | Tom Tromey <tromey@redhat.com> | 2012-11-12 17:37:32 +0000 |
---|---|---|
committer | Tom Tromey <tromey@redhat.com> | 2012-11-12 17:37:32 +0000 |
commit | 463288d719fec19e54633a159200f759633f21ea (patch) | |
tree | 0595da6eece3a3bb7bbb898309bdc24cbac38265 /gdb/typeprint.h | |
parent | fb60d514dcc6cb25180be2cf4ebdfe228b010ef9 (diff) | |
download | gdb-463288d719fec19e54633a159200f759633f21ea.tar.gz |
* c-typeprint.c (find_typedef_for_canonicalize,
print_name_maybe_canonical): New functions.
(c_print_type): Look up type name.
(cp_type_print_derivation_info): Add flags argument. Use
print_name_maybe_canonical.
(cp_type_print_method_args): Add wrapping.
(c_type_print_varspec_prefix): Use print_name_maybe_canonical.
(c_type_print_template_args): New function.
(c_type_print_base): Change wrapping. Use
print_name_maybe_canonical.
<TYPE_CODE_STRUCT>: Possibly create a typedef hash, and do
type name lookups.
* gdbtypes.c (types_equal): No longer static.
* gdbtypes.h (types_equal): Declare.
* typeprint.c (type_print_raw_options, default_ptype_flags):
Update.
(struct typedef_hash_table): New.
(hash_typedef_field, eq_typedef_field,
recursively_update_typedef_hash, add_template_parameters,
create_typedef_hash, free_typedef_hash, do_free_typedef_hash,
make_cleanup_free_typedef_hash, copy_typedef_hash_element,
copy_typedef_hash, find_typedef_in_hash): New functions.
* typeprint.h (struct type_print_options) <local_typedefs>:
New field.
(recursively_update_typedef_hash, add_template_parameters,
create_typedef_hash, free_typedef_hash,
make_cleanup_free_typedef_hash, copy_typedef_hash,
find_typedef_in_hash): Declare.
testsuite
* gdb.base/call-sc.exp: Use "ptype/r".
* gdb.base/volatile.exp: Don't expect "int".
* gdb.cp/ptype-flags.cc: New file.
* gdb.cp/ptype-flags.exp: New file.
* gdb.cp/templates.exp: Use ptype/r.
(test_ptype_of_templates, test_template_typedef): Likewise.
* lib/cp-support.exp (cp_test_ptype_class): Add in_ptype_arg
argument. Handle template names and template parameters.
* gdb.mi/mi-var-cmd.exp: Accept "long".
* gdb.mi/mi-var-child.exp: Accept "long".
* gdb.mi/mi-var-display.exp: Accept "long".
* gdb.mi/mi2-var-child.exp: Accept "long".
Diffstat (limited to 'gdb/typeprint.h')
-rw-r--r-- | gdb/typeprint.h | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/gdb/typeprint.h b/gdb/typeprint.h index 1e1509782f9..71bac018999 100644 --- a/gdb/typeprint.h +++ b/gdb/typeprint.h @@ -22,6 +22,7 @@ enum language; struct ui_file; +struct typedef_hash_table; struct type_print_options { @@ -33,10 +34,30 @@ struct type_print_options /* True means print typedefs in a class. */ unsigned int print_typedefs : 1; + + /* If not NULL, a local typedef hash table used when printing a + type. */ + struct typedef_hash_table *local_typedefs; }; extern const struct type_print_options type_print_raw_options; +void recursively_update_typedef_hash (struct typedef_hash_table *, + struct type *); + +void add_template_parameters (struct typedef_hash_table *, struct type *); + +struct typedef_hash_table *create_typedef_hash (void); + +void free_typedef_hash (struct typedef_hash_table *); + +struct cleanup *make_cleanup_free_typedef_hash (struct typedef_hash_table *); + +struct typedef_hash_table *copy_typedef_hash (struct typedef_hash_table *); + +const char *find_typedef_in_hash (const struct type_print_options *, + struct type *); + void print_type_scalar (struct type * type, LONGEST, struct ui_file *); void c_type_print_varspec_suffix (struct type *, struct ui_file *, int, |