From patchwork Mon Jul 29 14:25:48 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom de Vries X-Patchwork-Id: 33843 Received: (qmail 13044 invoked by alias); 29 Jul 2019 14:25:55 -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 13026 invoked by uid 89); 29 Jul 2019 14:25:53 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-26.0 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, KAM_NUMSUBJECT, SPF_PASS autolearn=ham version=3.3.1 spammy= X-HELO: mx1.suse.de Received: from mx2.suse.de (HELO mx1.suse.de) (195.135.220.15) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 29 Jul 2019 14:25:52 +0000 Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id 3FDC5AD08 for ; Mon, 29 Jul 2019 14:25:50 +0000 (UTC) Date: Mon, 29 Jul 2019 16:25:48 +0200 From: Tom de Vries To: gdb-patches@sourceware.org Subject: [committed][gdb/testsuite, 1/2] Fix gdb.linespec/explicit.exp with check-read1 Message-ID: <20190729142547.GA21025@delia> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.10.1 (2018-07-13) X-IsSubscribed: yes Hi, When running gdb.linespec/explicit.exp with check-read1, we get: ... (gdb) PASS: gdb.linespec/explicit.exp: complete unique file name: break -source "3explicit.c" break -source exp^Glicit^G^M explicit.c explicit2.c ^M (gdb) FAIL: gdb.linespec/explicit.exp: complete non-unique file name ... The problem is that we have a gdb_test_multiple where we match two regexps: ... set tst "complete non-unique file name" send_gdb "break -source exp\t" gdb_test_multiple "" $tst { -re "break -source exp\\\x07licit" { ... } -re "break -source exp\\\x07l" { # This pattern may occur when glibc debuginfo is installed. ... } } ... but since second is a substring of the first, we'll usually match the first, but with check-read1 we'll match the second. Fix this by using a single regexp and merging the related code. Tested on x86_64-linux. Committed to trunk. Thanks, - Tom [gdb/testsuite, 1/2] Fix gdb.linespec/explicit.exp with check-read1 gdb/testsuite/ChangeLog: 2019-07-29 Tom de Vries * gdb.linespec/explicit.exp: Fix gdb_test_multiple regexps where second is a substring of the first for "complete non-unique file name". --- gdb/testsuite/gdb.linespec/explicit.exp | 15 +-------------- 1 file changed, 1 insertion(+), 14 deletions(-) diff --git a/gdb/testsuite/gdb.linespec/explicit.exp b/gdb/testsuite/gdb.linespec/explicit.exp index 11656ca5c5..90181b3acb 100644 --- a/gdb/testsuite/gdb.linespec/explicit.exp +++ b/gdb/testsuite/gdb.linespec/explicit.exp @@ -241,20 +241,7 @@ namespace eval $testfile { -re "break -source exp\\\x07licit" { send_gdb "\t\t" gdb_test_multiple "" $tst { - -re "\\\x07\r\nexplicit.c\[ \t\]+explicit2.c\[ \t\]+\r\n$gdb_prompt" { - send_gdb "\n" - gdb_test "" \ - {Source filename requires function, label, or line offset.} \ - $tst - } - } - } - - -re "break -source exp\\\x07l" { - # This pattern may occur when glibc debuginfo is installed. - send_gdb "\t\t" - gdb_test_multiple "" $tst { - -re "\\\x07\r\nexplicit.c\[ \t\]+explicit2.c\[ \t\]+expl.*\r\n$gdb_prompt" { + -re "\\\x07\r\nexplicit.c\[ \t\]+explicit2.c\[ \t\]+\(expl.*\)?\r\n$gdb_prompt" { send_gdb "\n" gdb_test "" \ {Source filename requires function, label, or line offset.} \