From patchwork Wed Mar 19 15:57:55 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pedro Alves X-Patchwork-Id: 161 Return-Path: X-Original-To: siddhesh@wilcox.dreamhost.com Delivered-To: siddhesh@wilcox.dreamhost.com Received: from homiemail-mx20.g.dreamhost.com (caibbdcaaahc.dreamhost.com [208.113.200.72]) by wilcox.dreamhost.com (Postfix) with ESMTP id 22AB43600D6 for ; Wed, 19 Mar 2014 08:58:21 -0700 (PDT) Received: by homiemail-mx20.g.dreamhost.com (Postfix, from userid 14314964) id DA78A40FFB814; Wed, 19 Mar 2014 08:58:20 -0700 (PDT) X-Original-To: gdb@patchwork.siddhesh.in Delivered-To: x14314964@homiemail-mx20.g.dreamhost.com Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by homiemail-mx20.g.dreamhost.com (Postfix) with ESMTPS id B283640FE8B38 for ; Wed, 19 Mar 2014 08:58:20 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:subject:date:message-id:in-reply-to :references; q=dns; s=default; b=k7AtsXSEGDULyK5LXPbDmkbG4BCaxVj 49dYPE8NnMOqm4ANFLVhXYqaDdDcndcJKmCpRx2JyxweKeM/MiyOIgvVFR1q86kr MN8m9R1DatAtHmlFstLVhGUreEFssiLckuua6BRvNKeghykyoJnT8DTnklLqNPM+ tNoZiXIpSCns= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:subject:date:message-id:in-reply-to :references; s=default; bh=CNcL86xGC1Jb3OH/ubuaCvYjObA=; b=YyYHe TID5WPtLfS5Dp4FmyU/7t7spfDd4pqfSASfTCUzfLLwa9ZfZghVGeGMVNetDd7bJ wD+4Gmwl6G/GULUQbPcbrpi+/dL5oK9pkZQKhvdfY9OHvCjaTbnD9l9Xr4O8uk+p DObSJnhmJ46eABusb90CYFPmTDmZQv2g9xpTQU= Received: (qmail 19512 invoked by alias); 19 Mar 2014 15:58:07 -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 19402 invoked by uid 89); 19 Mar 2014 15:58:06 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.8 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 ESMTP; Wed, 19 Mar 2014 15:58:05 +0000 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id s2JFw4ka027814 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Wed, 19 Mar 2014 11:58:04 -0400 Received: from brno.lan (ovpn01.gateway.prod.ext.ams2.redhat.com [10.39.146.11]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id s2JFw1MD008699 for ; Wed, 19 Mar 2014 11:58:04 -0400 From: Pedro Alves To: gdb-patches@sourceware.org Subject: [PUSHED 2/8] gdb.base/async.exp: Don't hardcode line numbers. Date: Wed, 19 Mar 2014 15:57:55 +0000 Message-Id: <1395244681-24272-3-git-send-email-palves@redhat.com> In-Reply-To: <1395244681-24272-1-git-send-email-palves@redhat.com> References: <1395244681-24272-1-git-send-email-palves@redhat.com> X-DH-Original-To: gdb@patchwork.siddhesh.in gdb/testsuite/ 2014-03-19 Pedro Alves * gdb.base/async.c (main): Add "jump here" and "until here" line marker comments. * gdb.base/async.exp (jump_here): New global. (jump& test): Use it. (until_here): New global. (until& test): Use it. --- gdb/testsuite/ChangeLog | 9 +++++++++ gdb/testsuite/gdb.base/async.c | 4 ++-- gdb/testsuite/gdb.base/async.exp | 12 ++++++++---- 3 files changed, 19 insertions(+), 6 deletions(-) diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog index c1349b6..fa7b282 100644 --- a/gdb/testsuite/ChangeLog +++ b/gdb/testsuite/ChangeLog @@ -1,5 +1,14 @@ 2014-03-19 Pedro Alves + * gdb.base/async.c (main): Add "jump here" and "until here" line + marker comments. + * gdb.base/async.exp (jump_here): New global. + (jump& test): Use it. + (until_here): New global. + (until& test): Use it. + +2014-03-19 Pedro Alves + * gdb.base/async.exp: Don't frob gdb_protocol. 2014-03-18 Doug Evans diff --git a/gdb/testsuite/gdb.base/async.c b/gdb/testsuite/gdb.base/async.c index 0d9c875..fb53082 100644 --- a/gdb/testsuite/gdb.base/async.c +++ b/gdb/testsuite/gdb.base/async.c @@ -30,9 +30,9 @@ main () z = 9; y = foo (); z = y; - y = y + 2; + y = y + 2; /* jump here */ y = baz (); - return 0; + return 0; /* until here */ } diff --git a/gdb/testsuite/gdb.base/async.exp b/gdb/testsuite/gdb.base/async.exp index 1f465a6..d4b2b2d 100644 --- a/gdb/testsuite/gdb.base/async.exp +++ b/gdb/testsuite/gdb.base/async.exp @@ -103,17 +103,21 @@ gdb_expect { timeout { fail "(timeout) finish &" } } -send_gdb "jump 33&\n" +set jump_here [gdb_get_line_number "jump here"] + +send_gdb "jump $jump_here&\n" gdb_expect { - -re "^jump 33&.*Continuing at $hex.*$gdb_prompt.*Breakpoint 2, baz \\(\\) at.*async.c.*return 5.*completed\.\r\n" \ + -re "^jump $jump_here&.*Continuing at $hex.*$gdb_prompt.*Breakpoint 2, baz \\(\\) at.*async.c.*return 5.*completed\.\r\n" \ { pass "jump &" } -re ".*$gdb_prompt.*completed\.$" { fail "jump &" } timeout { fail "(timeout) jump &" } } -send_gdb "until 35&\n" +set until_here [gdb_get_line_number "until here"] + +send_gdb "until $until_here&\n" gdb_expect { - -re "^until 35&.*$gdb_prompt.*$hex in main \\(\\) at.*async.c.*y = baz \\(\\).*completed\.\r\n" \ + -re "^until $until_here&.*$gdb_prompt.*$hex in main \\(\\) at.*async.c.*y = baz \\(\\).*completed\.\r\n" \ { pass "until &" } -re "$gdb_prompt.*completed\.$" { fail "until &" } timeout { fail "(timeout) until &" }