From 649ce3f25afb756432e9e3c8558bf09f3daef4e5 Mon Sep 17 00:00:00 2001 From: Jason Merrill Date: Thu, 29 Nov 2001 21:38:43 -0500 Subject: dwarf2out.c (add_data_member_location_attribute): Do the right thing for virtual bases. * dwarf2out.c (add_data_member_location_attribute): Do the right thing for virtual bases. * dbxout.c (dbxout_type): For a virtual base, print the offset within the vtable. From-SVN: r47469 --- gcc/dbxout.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'gcc/dbxout.c') diff --git a/gcc/dbxout.c b/gcc/dbxout.c index 344ebbe..8b14f5d 100644 --- a/gcc/dbxout.c +++ b/gcc/dbxout.c @@ -1492,8 +1492,15 @@ dbxout_type (type, full) putc (TREE_VIA_VIRTUAL (child) ? '1' : '0', asmfile); putc (TREE_VIA_PUBLIC (child) ? '2' : '0', asmfile); CHARS (2); - print_wide_int (tree_low_cst (BINFO_OFFSET (child), 0) - * BITS_PER_UNIT); + if (TREE_VIA_VIRTUAL (child)) + /* For a virtual base, print the (negative) offset within + the vtable where we must look to find the necessary + adjustment. */ + print_wide_int (tree_low_cst (BINFO_VPTR_FIELD (child), 0) + * BITS_PER_UNIT); + else + print_wide_int (tree_low_cst (BINFO_OFFSET (child), 0) + * BITS_PER_UNIT); putc (',', asmfile); CHARS (1); dbxout_type (BINFO_TYPE (child), 0); -- cgit v1.1