PR c++/11226, PR c++/9629, PR c++/9688, PR c++/8890:
	* valops.c (search_struct_field): Compute nbases after calling
	CHECK_TYPEDEF.
	(check_field): Call CHECK_TYPEDEF.
	* cp-valprint.c (cp_print_value): Pass correct address to
	baseclass_offset.  Fix check for virtual base past the end of the
	object.  Don't offset address passed to cp_print_value_fields or
	apply_val_pretty_printer.
	(cp_print_value_fields): Fix call to val_print.
	(cp_print_value_fields_rtti): New function.
	* c-valprint.c (c_val_print): Use cp_print_value_fields_rtti.
	* p-valprint.c (pascal_object_print_value_fields): Fix call to
	val_print.
	* python/py-prettyprint.c (apply_val_pretty_printer): Add embedded
	offset to address.
	* language.h (struct language_defn) <la_val_print>: Document.
	* c-lang.h (cp_print_value_fields_rtti): Declare.
gdb/testsuite
	PR c++/11226, PR c++/9629, PR c++/9688, PR c++/8890:
	* gdb.cp/virtbase.cc: New file.
	* gdb.cp/virtbase.exp: New file.
	* gdb.cp/userdef.exp: Allow 'struct' or 'class'.
This commit is contained in:
Tom Tromey
2010-02-02 16:45:17 +00:00
parent 4339cae0bb
commit edf3d5f3f8
11 changed files with 223 additions and 15 deletions

View File

@@ -208,11 +208,32 @@ struct language_defn
void (*la_print_typedef) (struct type *type, struct symbol *new_symbol,
struct ui_file *stream);
/* Print a value using syntax appropriate for this language. */
/* Print a value using syntax appropriate for this language.
TYPE is the type of the sub-object to be printed.
int (*la_val_print) (struct type *, const gdb_byte *, int, CORE_ADDR,
struct ui_file *, int,
const struct value_print_options *);
CONTENTS holds the bits of the value. This holds the entire
enclosing object.
EMBEDDED_OFFSET is the offset into the outermost object of the
sub-object represented by TYPE. This is the object which this
call should print. Note that the enclosing type is not
available.
ADDRESS is the address in the inferior of the enclosing object.
STREAM is the stream on which the value is to be printed.
RECURSE is the recursion depth. It is zero-based.
OPTIONS are the formatting options to be used when
printing. */
int (*la_val_print) (struct type *type,
const gdb_byte *contents,
int embedded_offset, CORE_ADDR address,
struct ui_file *stream, int recurse,
const struct value_print_options *options);
/* Print a top-level value using syntax appropriate for this language. */