diff options
author | Tom Tromey <tromey@redhat.com> | 2010-02-02 23:40:28 +0000 |
---|---|---|
committer | Tom Tromey <tromey@redhat.com> | 2010-02-02 23:40:28 +0000 |
commit | 9c3c02fd158a5a0f8d64ec1c36078b1c9df0e6fc (patch) | |
tree | c1cdfef1022c3f73c6eabc8d781791261efb1d86 /gdb/testsuite | |
parent | f23f4c5973c3ad96ecf812036c6b0ee5a17d726f (diff) | |
download | gdb-9c3c02fd158a5a0f8d64ec1c36078b1c9df0e6fc.zip gdb-9c3c02fd158a5a0f8d64ec1c36078b1c9df0e6fc.tar.gz gdb-9c3c02fd158a5a0f8d64ec1c36078b1c9df0e6fc.tar.bz2 |
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.
Diffstat (limited to 'gdb/testsuite')
-rw-r--r-- | gdb/testsuite/ChangeLog | 6 | ||||
-rw-r--r-- | gdb/testsuite/gdb.cp/virtbase.cc | 32 | ||||
-rw-r--r-- | gdb/testsuite/gdb.cp/virtbase.exp | 5 |
3 files changed, 43 insertions, 0 deletions
diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog index 1a78e54..4e0ba4c 100644 --- a/gdb/testsuite/ChangeLog +++ b/gdb/testsuite/ChangeLog @@ -1,5 +1,11 @@ 2010-02-02 Tom Tromey <tromey@redhat.com> + * gdb.cp/virtbase.exp: Add regression tests. + * gdb.cp/virtbase.cc (RHA, RHB, RHC): New classes. + (main): Instantiate RHC. + +2010-02-02 Tom Tromey <tromey@redhat.com> + * gdb.dwarf2/member-ptr-forwardref.exp: Update expected result for type-printing change. diff --git a/gdb/testsuite/gdb.cp/virtbase.cc b/gdb/testsuite/gdb.cp/virtbase.cc index ae0a2c7..fed5927 100644 --- a/gdb/testsuite/gdb.cp/virtbase.cc +++ b/gdb/testsuite/gdb.cp/virtbase.cc @@ -46,12 +46,44 @@ struct D:virtual C{}; class E:B,D{}; +// These classes are for another regression test, from +// https://bugzilla.redhat.com/show_bug.cgi?id=560741 + +class RHA +{ +public: + RHA() : mA(0xaaaaaaaa) {} + virtual void a() = 0; + int mA; +}; + +class RHB +{ +public: + RHB() : mB(0xbbbbbbbb) {} + virtual void b() = 0; + int mB; +}; + +class RHC : public RHA, + public RHB +{ +public: + RHC() : RHA(), RHB() {} + virtual void a() {} + virtual void b() {} +}; + + + + int main() { ph::Derived tst; tst.get_y(); tst.get_z(); E *e = new E; + RHB *b = new RHC(); return 0; // breakpoint 3 } diff --git a/gdb/testsuite/gdb.cp/virtbase.exp b/gdb/testsuite/gdb.cp/virtbase.exp index 6a37626..5a0de97 100644 --- a/gdb/testsuite/gdb.cp/virtbase.exp +++ b/gdb/testsuite/gdb.cp/virtbase.exp @@ -55,3 +55,8 @@ gdb_continue_to_breakpoint "third breakpoint" # In PR 9629, we failed to print v correctly here. gdb_test "print *(D *) e" " = {<C> = {v = 11}, _vptr.D = $hex}" + +# A regression test reported to Red Hat bugzilla, see: +# https://bugzilla.redhat.com/show_bug.cgi?id=560741 +gdb_test "set print object on" "" +gdb_test "print/x b->mA" " = 0xaaaaaaaa" |