Commit Graph

4 Commits

Author SHA1 Message Date
Pedro Alves 580688f393 gdb/
* c-valprint.c (c_value_print): When doing virtual base pointer
	adjustment, create a new value with adjusted contents rather than
	changing the contents of the value being printed (and getting it
	wrong).

	gdb/testsuite/
	* gdb.cp/virtbase.cc (VirtualBase, VirtualMiddleA, VirtualMiddleB)
	(Virtual): New structs.
	(virtual_o, virtual_middle_b): New globals.
	* gdb.cp/virtbase.exp: New tests.
2011-02-02 17:41:54 +00:00
Jan Kratochvil 9655fd1aec gdb/
Fix modification of cplus_struct_default.
	* dwarf2read.c (dwarf2_add_member_fn) <no DW_AT_vtable_elem_location>:
	Call ALLOCATE_CPLUS_STRUCT_TYPE.
	* gdbtypes.c (cplus_struct_default): New empty initializer, comment it.

gdb/testsuite/
	* gdb.cp/virtbase.cc (class RTTI_base, class RTTI_data)
	(main) <rtti_data>: New.
	* gdb.cp/virtbase.exp (print rtti_data): New.
2010-06-28 20:12:53 +00:00
Tom Tromey 9c3c02fd15 gdb
* valops.c (value_cast_structs): Try downcasting using the RTTI
	type.
gdb/testsuite
	* gdb.cp/virtbase.exp: Add regression tests.
	* gdb.cp/virtbase.cc (RHA, RHB, RHC): New classes.
	(main): Instantiate RHC.
2010-02-02 23:40:28 +00:00
Tom Tromey edf3d5f3f8 gdb
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'.
2010-02-02 16:45:17 +00:00