From fdcfef12c3bbebb20583132c2ba8a86ce299fd57 Mon Sep 17 00:00:00 2001 From: Pedro Alves Date: Tue, 21 Feb 2012 22:58:39 +0000 Subject: [PATCH] 2012-02-21 Pedro Alves * gdb.trace/unavailable.exp (gdb_collect_globals_test): Use with_test_prefix. --- gdb/testsuite/ChangeLog | 5 ++ gdb/testsuite/gdb.trace/unavailable.exp | 68 +++++++++++-------------- 2 files changed, 36 insertions(+), 37 deletions(-) diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog index 2f184bf3354..cea203b8fc4 100644 --- a/gdb/testsuite/ChangeLog +++ b/gdb/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2012-02-21 Pedro Alves + + * gdb.trace/unavailable.exp (gdb_collect_globals_test): Use + with_test_prefix. + 2012-02-21 Pedro Alves * gdb.arch/altivec-abi.exp (altivec_abi_tests): Don't do diff --git a/gdb/testsuite/gdb.trace/unavailable.exp b/gdb/testsuite/gdb.trace/unavailable.exp index 9130b4b74be..be79b8675d6 100644 --- a/gdb/testsuite/gdb.trace/unavailable.exp +++ b/gdb/testsuite/gdb.trace/unavailable.exp @@ -496,49 +496,43 @@ proc gdb_collect_globals_test { } { with_test_prefix "collect globals" { gdb_test_no_output "set print object on" - global pf_prefix - set old_pf_prefix $pf_prefix - append pf_prefix " print object on:" - - # With print object on, printing a pointer may need to fetch the - # pointed-to object, to check its run-time type. Make sure that - # fails gracefully and transparently when the pointer itself is - # unavailable. - gdb_test "print virtualp" " = \\(Virtual \\*\\) " - - # no vtable pointer available - gdb_test "print derived_unavail" \ - " = { = , _vptr.Derived = , z = }" - - # vtable pointer available, but nothing else - gdb_test "print derived_partial" \ - " = \\(Derived\\) { = { = , _vptr.Middle = , y = }, _vptr.Derived = $hex, z = }" - - # whole object available - gdb_test "print derived_whole" \ - " = \\(Derived\\) { = { = {x = 2}, _vptr.Middle = $hex, y = 3}, _vptr.Derived = $hex, z = 4}" - - set pf_prefix $old_pf_prefix + with_test_prefix "print object on" { + # With print object on, printing a pointer may need to fetch + # the pointed-to object, to check its run-time type. Make + # sure that fails gracefully and transparently when the + # pointer itself is unavailable. + gdb_test "print virtualp" " = \\(Virtual \\*\\) " + + # no vtable pointer available + gdb_test "print derived_unavail" \ + " = { = , _vptr.Derived = , z = }" + + # vtable pointer available, but nothing else + gdb_test "print derived_partial" \ + " = \\(Derived\\) { = { = , _vptr.Middle = , y = }, _vptr.Derived = $hex, z = }" + + # whole object available + gdb_test "print derived_whole" \ + " = \\(Derived\\) { = { = {x = 2}, _vptr.Middle = $hex, y = 3}, _vptr.Derived = $hex, z = 4}" + } gdb_test_no_output "set print object off" - append pf_prefix " print object off:" - - gdb_test "print virtualp" " = \\(Virtual \\*\\) " + with_test_prefix "print object off" { + gdb_test "print virtualp" " = \\(Virtual \\*\\) " - # no vtable pointer available - gdb_test "print derived_unavail" \ - " = { = , _vptr.Derived = , z = }" + # no vtable pointer available + gdb_test "print derived_unavail" \ + " = { = , _vptr.Derived = , z = }" - # vtable pointer available, but nothing else - gdb_test "print derived_partial" \ - " = { = { = , _vptr.Middle = , y = }, _vptr.Derived = $hex, z = }" + # vtable pointer available, but nothing else + gdb_test "print derived_partial" \ + " = { = { = , _vptr.Middle = , y = }, _vptr.Derived = $hex, z = }" - # whole object available - gdb_test "print derived_whole" \ - " = { = { = {x = 2}, _vptr.Middle = $hex, y = 3}, _vptr.Derived = $hex, z = 4}" - - set pf_prefix $old_pf_prefix + # whole object available + gdb_test "print derived_whole" \ + " = { = { = {x = 2}, _vptr.Middle = $hex, y = 3}, _vptr.Derived = $hex, z = 4}" + } # An instance of a virtual class where we collected everything but # the vptr. -- 2.30.2