From patchwork Tue Apr 21 18:08:11 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pedro Alves X-Patchwork-Id: 6351 Received: (qmail 92656 invoked by alias); 21 Apr 2015 18:08:42 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Delivered-To: mailing list gdb-patches@sourceware.org Received: (qmail 92456 invoked by uid 89); 21 Apr 2015 18:08:40 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=AWL, BAYES_00, SPF_HELO_PASS, SPF_PASS, T_RP_MATCHES_RCVD autolearn=ham version=3.3.2 X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-GCM-SHA384 encrypted) ESMTPS; Tue, 21 Apr 2015 18:08:39 +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 t3LI8bBn017243 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL) for ; Tue, 21 Apr 2015 14:08:37 -0400 Received: from brno.lan (ovpn01.gateway.prod.ext.ams2.redhat.com [10.39.146.11]) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id t3LI8WKr028722 for ; Tue, 21 Apr 2015 14:08:36 -0400 From: Pedro Alves To: gdb-patches@sourceware.org Subject: [PATCH 04/24] Don't rely on inferior I/O in gdb.base/siginfo-addr.exp Date: Tue, 21 Apr 2015 19:08:11 +0100 Message-Id: <1429639711-16459-5-git-send-email-palves@redhat.com> In-Reply-To: <1429639711-16459-1-git-send-email-palves@redhat.com> References: <1429639711-16459-1-git-send-email-palves@redhat.com> No point in relying on stdio in this test. Simply run to a breakpoint instead. gdb/testsuite/ChangeLog: 2015-04-21 Pedro Alves * gdb.base/siginfo-addr.c (pass): New function. (handler): Call it iff si_addr is correct. * gdb.base/siginfo-addr.exp: Remove gdb_skip_stdio_test check. Set a breakpoint at "pass" and continue to it. --- gdb/testsuite/gdb.base/siginfo-addr.c | 9 ++++++--- gdb/testsuite/gdb.base/siginfo-addr.exp | 17 +++-------------- 2 files changed, 9 insertions(+), 17 deletions(-) diff --git a/gdb/testsuite/gdb.base/siginfo-addr.c b/gdb/testsuite/gdb.base/siginfo-addr.c index a074b4d..c6d8556 100644 --- a/gdb/testsuite/gdb.base/siginfo-addr.c +++ b/gdb/testsuite/gdb.base/siginfo-addr.c @@ -26,13 +26,16 @@ static void *p; +void +pass (void) +{ +} + static void handler (int sig, siginfo_t *info, void *context) { if (info->si_addr == p) - printf ("Correct si_addr value.\n"); - else - printf ("Got si_addr = %p, expected %p.\n", info->si_addr, p); + pass (); _exit (0); } diff --git a/gdb/testsuite/gdb.base/siginfo-addr.exp b/gdb/testsuite/gdb.base/siginfo-addr.exp index 5ac6105..e2f5914 100644 --- a/gdb/testsuite/gdb.base/siginfo-addr.exp +++ b/gdb/testsuite/gdb.base/siginfo-addr.exp @@ -26,11 +26,6 @@ if [target_info exists gdb,nosignals] { continue } -if [gdb_skip_stdio_test "siginfo-addr.exp"] { - continue -} - - standard_testfile if {[prepare_for_testing $testfile.exp $testfile $srcfile debug]} { untested "Couldn't compile ${srcfile}.c" @@ -47,13 +42,7 @@ if { ![runto_main] } then { # Run to the signal. gdb_test "continue" ".*Program received signal SIGSEGV.*" "continue to signal" +gdb_breakpoint "pass" + # Check for correct si_addr. -set test "program exit" -gdb_test_multiple "continue" "${test}" { - -re "Correct si_addr" { - pass "si_addr value" - } - -re "Got si_addr" { - fail "si_addr value" - } -} +gdb_test "continue" "Breakpoint .* pass .*" "correct si_addr"