From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id rB9BDFbEu2FobQAAWB0awg (envelope-from ) for ; Thu, 16 Dec 2021 17:57:26 -0500 Received: by simark.ca (Postfix, from userid 112) id 1EC9B1F0BD; Thu, 16 Dec 2021 17:57:26 -0500 (EST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-3.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 Received: from sourceware.org (server2.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id 778951ECEB for ; Thu, 16 Dec 2021 17:57:25 -0500 (EST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 8E4503858423 for ; Thu, 16 Dec 2021 22:57:24 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 8E4503858423 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1639695444; bh=imOdXUdx4lMRKGf2y4fQH0OMIcaUqSTYP2+hPFjEb/4=; h=Date:To:Subject:References:In-Reply-To:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc: From; b=O6yQi9HRCDepH+nFfjsAYv6UdNsdZMrPKR+kbolRNHzEpTHvW+flv2NWoFaBzI+XC S/rzkxTpbl2Q+aRaw14poOtzI+6nwVboq2O0WhTv6SV4fJclUlgLP/UKsh5R67pTnl bpkvzAZu6Rvsa6tgFIHlqzAfaDsMzk8PAK5S9PF0= Received: from lndn.lancelotsix.com (vps-42846194.vps.ovh.net [IPv6:2001:41d0:801:2000::2400]) by sourceware.org (Postfix) with ESMTPS id 8F76C3858D35 for ; Thu, 16 Dec 2021 22:57:05 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 8F76C3858D35 Received: from Plymouth (unknown [IPv6:2a02:390:9086:0:7c27:fcf5:8e6d:c1bd]) by lndn.lancelotsix.com (Postfix) with ESMTPSA id 9954480D5D; Thu, 16 Dec 2021 22:57:04 +0000 (UTC) Date: Thu, 16 Dec 2021 22:57:01 +0000 To: Pedro Alves Subject: Re: [PATCH 21/29] gdb/testsuite: Remove duplicates from gdb.base/shlib-call.exp Message-ID: <20211216225701.ufirbtwtqxd6o4kt@Plymouth> References: <20211121175636.779325-1-lsix@lancelotsix.com> <20211121175636.779325-22-lsix@lancelotsix.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.5.11 (lndn.lancelotsix.com [0.0.0.0]); Thu, 16 Dec 2021 22:57:04 +0000 (UTC) X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , From: Lancelot SIX via Gdb-patches Reply-To: Lancelot SIX Cc: gdb-patches@sourceware.org Errors-To: gdb-patches-bounces+public-inbox=simark.ca@sourceware.org Sender: "Gdb-patches" > Let's not fix DUPLICATEs with duplication. :-) Write instead: > > with_test_prefix "after restart" { > gdb_test_no_output "set print sevenbit-strings" > gdb_test_no_output "set print address off" > gdb_test_no_output "set width 0" > } > > Actually, I take that back. We should just delete these 3 "set" commands and the same ones > at the bottom too. Setting width to 0 is already done centrally. The other two make > no difference in this test. I strongly suspect this is very very old test code. > > The "Start with a fresh gdb" block could just use clean_restart. Hi, I did the changes and added some more cleanup (removed trailing whitespaces). Thanks, Lancelot. --- >From 9648f0f6164059dac483c217c8e82784a2a2b7c1 Mon Sep 17 00:00:00 2001 From: Lancelot SIX Date: Sun, 21 Nov 2021 01:33:13 +0000 Subject: [PATCH] gdb/testsuite: Remove duplicates from gdb.base/shlib-call.exp When I run the testsuite, I have: Running .../gdb/testsuite/gdb.base/shlib-call.exp ... DUPLICATE: gdb.base/shlib-call.exp: print g DUPLICATE: gdb.base/shlib-call.exp: set print sevenbit-strings DUPLICATE: gdb.base/shlib-call.exp: set print address off DUPLICATE: gdb.base/shlib-call.exp: set width 0 DUPLICATE: gdb.base/shlib-call.exp: continue until exit Fix by adjusting the test names when required, and by removing un-necessary commands. While at it, do some cleanup: - Replace an explicit GDB restart sequence with a call to clean_restart. - Remove trailing whitespaces. - Use $gdb_test_name in gdb_test_multiple. Tested on x86_64-linux. --- gdb/testsuite/gdb.base/shlib-call.exp | 21 +++++++-------------- 1 file changed, 7 insertions(+), 14 deletions(-) diff --git a/gdb/testsuite/gdb.base/shlib-call.exp b/gdb/testsuite/gdb.base/shlib-call.exp index 0a5a1c336c1..3fe9932af99 100644 --- a/gdb/testsuite/gdb.base/shlib-call.exp +++ b/gdb/testsuite/gdb.base/shlib-call.exp @@ -90,7 +90,7 @@ if ![gdb_skip_stdio_test "next over shr1"] { #print g -gdb_test "print g" "\[0-9\]* = 2" +gdb_test "print g" "\[0-9\]* = 2" "print g two" #print shr1(1) if ![gdb_skip_stdio_test "print shr1(1)"] { @@ -137,7 +137,7 @@ gdb_test "print mainshr1(1)" "\[0-9\]* = 2" \ # behavior will differ depending upon upon whether or not # the compiler emits line number information for the epilogue. gdb_test_multiple "step" "step out of shr2 to main" { - -re "main \\(\\) at.*g = mainshr1\\(g\\);.*$gdb_prompt $" { + -re "main \\(\\) at.*g = mainshr1\\(g\\);.*$gdb_prompt $" { pass "step out of shr2 to main" } -re ".*\\\}.*$gdb_prompt $" { @@ -152,7 +152,7 @@ gdb_test_multiple "step" "step out of shr2 to main" { } } } - + #print mainshr1(1) gdb_test "print mainshr1(1)" "\[0-9\]* = 2" @@ -162,14 +162,7 @@ gdb_test "step" "mainshr1 \\(g=4\\) at.*return 2.g;" \ # Start with a fresh gdb. -gdb_exit -gdb_start -gdb_reinitialize_dir $srcdir/$subdir -gdb_load ${binfile} -gdb_test_no_output "set print sevenbit-strings" -gdb_test_no_output "set print address off" -gdb_test_no_output "set width 0" - +clean_restart $binfile # PR's 16495, 18213 # test that we can re-set breakpoints in shared libraries @@ -179,7 +172,7 @@ set test "run to bp in shared library" gdb_run_cmd gdb_test_multiple "" $test { -re "Breakpoint .,.*${gdb_prompt} " { - pass $test + pass $gdb_test_name } } @@ -189,8 +182,8 @@ set test "re-run to bp in shared library (PR's 16495, 18213)" gdb_run_cmd gdb_test_multiple "" $test { -re "Breakpoint .,.*${gdb_prompt} " { - pass $test + pass $gdb_test_name } } -gdb_continue_to_end "" continue 1 +gdb_continue_to_end "after re-run" continue 1