From b4893d482803eb1c4241ff751193fdcf0bf6650c Mon Sep 17 00:00:00 2001 From: Tom Tromey Date: Wed, 22 Aug 2012 14:27:49 +0000 Subject: * lib/gdb.exp (skip_unwinder_tests): New proc. * gdb.cp/nextoverthrow.exp: Use skip_unwinder_tests. * gdb.java/jnpe.exp: Use skip_unwinder_tests. --- gdb/testsuite/ChangeLog | 6 ++++++ gdb/testsuite/gdb.cp/nextoverthrow.exp | 30 +-------------------------- gdb/testsuite/gdb.java/jnpe.exp | 15 +------------- gdb/testsuite/lib/gdb.exp | 37 ++++++++++++++++++++++++++++++++++ 4 files changed, 45 insertions(+), 43 deletions(-) (limited to 'gdb') diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog index e6e8b01..dbc2744 100644 --- a/gdb/testsuite/ChangeLog +++ b/gdb/testsuite/ChangeLog @@ -1,3 +1,9 @@ +2012-08-22 Tom Tromey + + * lib/gdb.exp (skip_unwinder_tests): New proc. + * gdb.cp/nextoverthrow.exp: Use skip_unwinder_tests. + * gdb.java/jnpe.exp: Use skip_unwinder_tests. + 2012-08-21 Tom Tromey * gdb.hp/gdb.aCC/exception.exp: Remove. diff --git a/gdb/testsuite/gdb.cp/nextoverthrow.exp b/gdb/testsuite/gdb.cp/nextoverthrow.exp index 53f59d7..488ae87 100644 --- a/gdb/testsuite/gdb.cp/nextoverthrow.exp +++ b/gdb/testsuite/gdb.cp/nextoverthrow.exp @@ -34,35 +34,7 @@ if ![runto_main] then { continue } -# See whether we have the needed unwinder hooks. -set ok 1 -gdb_test_multiple "print _Unwind_DebugHook" "check for unwinder hook" { - -re "= .*no debug info.*_Unwind_DebugHook.*\r\n$gdb_prompt $" { - # Pass the test so we don't get bogus fails in the results. - pass "check for unwinder hook" - set ok 0 - } - -re "= .*_Unwind_DebugHook.*\r\n$gdb_prompt $" { - pass "check for unwinder hook" - } - -re "No symbol .* in current context.\r\n$gdb_prompt $" { - # Pass the test so we don't get bogus fails in the results. - pass "check for unwinder hook" - set ok 0 - } -} -if {!$ok} { - gdb_test_multiple "info probe" "check for stap probe in unwinder" { - -re ".*libgcc.*unwind.*\r\n$gdb_prompt $" { - pass "check for stap probe in unwinder" - set ok 1 - } - -re "\r\n$gdb_prompt $" { - } - } -} - -if {!$ok} { +if {![skip_unwinder_tests]} { unsupported "nextoverthrow.exp could not find _Unwind_DebugHook" return -1 } diff --git a/gdb/testsuite/gdb.java/jnpe.exp b/gdb/testsuite/gdb.java/jnpe.exp index f7225d8..b15ee32 100644 --- a/gdb/testsuite/gdb.java/jnpe.exp +++ b/gdb/testsuite/gdb.java/jnpe.exp @@ -31,20 +31,7 @@ if ![runto "$testfile.java:$line"] then { continue } -# See whether we have the needed unwinder hooks. -set ok 1 -gdb_test_multiple "print _Unwind_DebugHook" "check for unwinder hook in java" { - -re "= .*_Unwind_DebugHook.*\r\n$gdb_prompt $" { - pass "check for unwinder hook in java" - } - -re "No symbol .* in current context.?\r\n$gdb_prompt $" { - # Pass the test so we don't get bogus fails in the results. - setup_xfail *-*-* - fail "check for unwinder hook in java" - set ok 0 - } -} -if {!$ok} { +if {![skip_unwinder_tests]} { unsupported "jnpe.exp could not find _Unwind_DebugHook" return -1 } diff --git a/gdb/testsuite/lib/gdb.exp b/gdb/testsuite/lib/gdb.exp index 4f2b7c9..0b02f76 100644 --- a/gdb/testsuite/lib/gdb.exp +++ b/gdb/testsuite/lib/gdb.exp @@ -2093,6 +2093,43 @@ proc skip_hw_watchpoint_access_tests {} { return 0 } +# Return 1 if we should skip tests that require the runtime unwinder +# hook. This must be invoked while gdb is running, after shared +# libraries have been loaded. This is needed because otherwise a +# shared libgcc won't be visible. + +proc skip_unwinder_tests {} { + global gdb_prompt + + set ok 1 + gdb_test_multiple "print _Unwind_DebugHook" "check for unwinder hook" { + -re "= .*no debug info.*_Unwind_DebugHook.*\r\n$gdb_prompt $" { + # Pass the test so we don't get bogus fails in the results. + pass "check for unwinder hook" + set ok 0 + } + -re "= .*_Unwind_DebugHook.*\r\n$gdb_prompt $" { + pass "check for unwinder hook" + } + -re "No symbol .* in current context.\r\n$gdb_prompt $" { + # Pass the test so we don't get bogus fails in the results. + pass "check for unwinder hook" + set ok 0 + } + } + if {!$ok} { + gdb_test_multiple "info probe" "check for stap probe in unwinder" { + -re ".*libgcc.*unwind.*\r\n$gdb_prompt $" { + pass "check for stap probe in unwinder" + set ok 1 + } + -re "\r\n$gdb_prompt $" { + } + } + } + return $ok +} + set compiler_info "unknown" set gcc_compiled 0 set hp_cc_compiler 0 -- cgit v1.1