From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 23528 invoked by alias); 14 Aug 2012 16:20:45 -0000 Received: (qmail 23339 invoked by uid 22791); 14 Aug 2012 16:20:38 -0000 X-SWARE-Spam-Status: No, hits=-6.5 required=5.0 tests=AWL,BAYES_00,KHOP_RCVD_UNTRUST,RCVD_IN_DNSWL_HI,RCVD_IN_HOSTKARMA_W,SPF_HELO_PASS,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 14 Aug 2012 16:20:23 +0000 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id q7EGKGmg000651 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Tue, 14 Aug 2012 12:20:23 -0400 Received: from barimba (ovpn01.gateway.prod.ext.phx2.redhat.com [10.5.9.1]) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id q7EGKEGX025402 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NO); Tue, 14 Aug 2012 12:20:15 -0400 From: Tom Tromey To: gdb-patches@sourceware.org Subject: RFC: consolidate checks for _Unwind_DebugHook in test suite Date: Tue, 14 Aug 2012 16:20:00 -0000 Message-ID: <877gt1zbr5.fsf@fleche.redhat.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2012-08/txt/msg00408.txt.bz2 I happened to notice that nextoverthrow.exp checks for the sdt.h probe points, but jnpe.exp does not. This patch consolidates the checking code into a new function in gdb.exp. Tom * lib/gdb.exp (skip_unwinder_tests): New proc. * gdb.cp/nextoverthrow.exp: Use skip_unwinder_tests. * gdb.java/jnpe.exp: Use skip_unwinder_tests. 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 17e2117..daa50f5 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