binutils-gdb/gdb/typeprint.h
Tom Tromey bd69fc683f * 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".
2012-11-12 17:37:38 +00:00

70 lines
2.2 KiB
C

/* Language independent support for printing types for GDB, the GNU debugger.
Copyright (C) 1986, 1988-1989, 1991-1993, 1999-2000, 2007-2012 Free
Software Foundation, Inc.
This file is part of GDB.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#ifndef TYPEPRINT_H
#define TYPEPRINT_H
enum language;
struct ui_file;
struct typedef_hash_table;
struct type_print_options
{
/* True means that no special printing flags should apply. */
unsigned int raw : 1;
/* True means print methods in a class. */
unsigned int print_methods : 1;
/* 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,
int, int, const struct type_print_options *);
void c_type_print_args (struct type *, struct ui_file *, int, enum language,
const struct type_print_options *);
#endif