1 http://sourceware.org/ml/gdb-cvs/2012-09/msg00169.html
3 ### src/gdb/ChangeLog 2012/09/27 12:53:57 1.14718
4 ### src/gdb/ChangeLog 2012/09/27 16:04:18 1.14719
6 +2012-09-27 Tom Tromey <tromey@redhat.com>
8 + Fix https://bugzilla.redhat.com/show_bug.cgi?id=849357
9 + * cp-valprint.c (cp_print_value_fields): Use get_vptr_fieldno.
11 2012-09-27 Joel Brobecker <brobecker@adacore.com>
13 * sol-thread.c (sol_thread_fetch_registers)
14 --- src/gdb/cp-valprint.c 2012/07/06 05:36:07 1.85
15 +++ src/gdb/cp-valprint.c 2012/09/27 16:04:22 1.86
18 int statmem_obstack_initial_size = 0;
19 int stat_array_obstack_initial_size = 0;
21 + struct type *vptr_basetype = NULL;
24 if (dont_print_statmem == 0)
26 statmem_obstack_initial_size =
31 + vptr_fieldno = get_vptr_fieldno (type, &vptr_basetype);
32 for (i = n_baseclasses; i < len; i++)
34 /* If requested, skip printing of static fields. */
36 v, stream, recurse + 1,
39 - else if (i == TYPE_VPTR_FIELDNO (type))
40 + else if (i == vptr_fieldno && type == vptr_basetype)
42 int i_offset = offset + TYPE_FIELD_BITPOS (type, i) / 8;
43 struct type *i_type = TYPE_FIELD_TYPE (type, i);
44 ### src/gdb/testsuite/ChangeLog 2012/09/26 19:50:12 1.3396
45 ### src/gdb/testsuite/ChangeLog 2012/09/27 16:04:22 1.3397
47 +2012-09-27 Tom Tromey <tromey@redhat.com>
49 + * gdb.cp/derivation.exp: Add regression test.
50 + * gdb.cp/derivation.cc (class V_base, class V_inter, class
52 + (vderived): New global.
54 2012-09-26 Tom Tromey <tromey@redhat.com>
56 * gdb.dwarf2/dw2-common-block.S: New file.
57 --- src/gdb/testsuite/gdb.cp/derivation.cc 2011/12/13 17:22:08 1.2
58 +++ src/gdb/testsuite/gdb.cp/derivation.cc 2012/09/27 16:04:23 1.3
75 +class V_inter : public virtual V_base
87 +class V_derived : public V_inter
97 --- src/gdb/testsuite/gdb.cp/derivation.exp 2012/07/10 15:18:18 1.19
98 +++ src/gdb/testsuite/gdb.cp/derivation.exp 2012/09/27 16:04:23 1.20
101 gdb_test "print g_instance.bfoo()" "\\$\[0-9\]+ = 2" "print value of g_instance.bfoo()"
102 gdb_test "print g_instance.cfoo()" "\\$\[0-9\]+ = 3" "print value of g_instance.cfoo()"
104 +# This is a regression test for a bug that caused a crash when trying
105 +# to print the vtbl pointer. We don't care about the output so much
106 +# here (it is tested elsewhere), just that gdb doesn't crash. We test
107 +# "ptype" first because, before the gdb fix, that was the only code
108 +# path calling get_vptr_fieldno.
109 +gdb_test "ptype vderived" "type = .*"
110 +gdb_test "print vderived" " = {.* inter = 0.*x = 0}"