From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lndn.lancelotsix.com (vps-42846194.vps.ovh.net [IPv6:2001:41d0:801:2000::2400]) by sourceware.org (Postfix) with ESMTPS id B84A43858D28 for ; Thu, 16 Dec 2021 23:48:36 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org B84A43858D28 Received: from Plymouth (unknown [IPv6:2a02:390:9086:0:7c27:fcf5:8e6d:c1bd]) by lndn.lancelotsix.com (Postfix) with ESMTPSA id E86CA80D5D; Thu, 16 Dec 2021 23:48:35 +0000 (UTC) Date: Thu, 16 Dec 2021 23:48:32 +0000 From: Lancelot SIX To: Pedro Alves Cc: gdb-patches@sourceware.org Subject: Re: [PATCH 08/12] gdb/testsuite: Remove duplicates from gdb.mi/mi-nonstop-exit.exp Message-ID: <20211216234754.3bgibio4sb7hujom@Plymouth> References: <20211126230038.103225-1-lsix@lancelotsix.com> <20211126230038.103225-9-lsix@lancelotsix.com> <82c036ab-e9ee-ce09-498e-c419c84a58cd@palves.net> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <82c036ab-e9ee-ce09-498e-c419c84a58cd@palves.net> 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 23:48:36 +0000 (UTC) X-Spam-Status: No, score=-12.0 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org 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: , X-List-Received-Date: Thu, 16 Dec 2021 23:48:38 -0000 > > There is a slight modification of behaviour introduced by this patch. > > mi_delete_breakpoints is called one more time just before quitting gdb, > > which is in my opinion is worth given the simplification. > > It's much more typical to delete breakpoints _before_ running to main. I.e., > putting the "restart" code at the beginning. If that works, I'd mildly prefer that. > > This is OK either way. > I have changed this, and the test still happy. Thanks for the review, Lancelot. --- >From 14a33ceabb1fbe46c94ee709e8c8cd8ae96397ba Mon Sep 17 00:00:00 2001 From: Lancelot SIX Date: Tue, 23 Nov 2021 13:42:13 +0000 Subject: [PATCH] gdb/testsuite: Remove duplicates from gdb.mi/mi-nonstop-exit.exp MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When running the testsuite, I have: Running .../gdb/testsuite/gdb.mi/mi-nonstop-exit.exp ... DUPLICATE: gdb.mi/mi-nonstop-exit.exp: breakpoint at main DUPLICATE: gdb.mi/mi-nonstop-exit.exp: mi runto main This test runs the same sequence of operations twice. Refactor the code by running both of those sequences within a foreach_with_prefix block to ensure that the commands have unique test names. Tested on x86_64-linux. --- gdb/testsuite/gdb.mi/mi-nonstop-exit.exp | 23 +++++++---------------- 1 file changed, 7 insertions(+), 16 deletions(-) diff --git a/gdb/testsuite/gdb.mi/mi-nonstop-exit.exp b/gdb/testsuite/gdb.mi/mi-nonstop-exit.exp index 99ac92f15a3..8da585b48df 100644 --- a/gdb/testsuite/gdb.mi/mi-nonstop-exit.exp +++ b/gdb/testsuite/gdb.mi/mi-nonstop-exit.exp @@ -39,24 +39,15 @@ save_vars { GDBFLAGS } { mi_gdb_test "-gdb-set mi-async 1" ".*" mi_detect_async -if { [mi_runto_main] < 0 } { - continue -} - -mi_send_resuming_command "exec-continue" "continue" - -mi_expect_stop "exited-normally" "" "" "" "" "" "finished exec continue" +foreach_with_prefix iteration {1 2} { + mi_delete_breakpoints + if { [mi_runto_main] < 0 } { + continue + } -# Run the program again. + mi_send_resuming_command "exec-continue" "continue" -mi_delete_breakpoints - -if { [mi_runto_main] < 0 } { - continue + mi_expect_stop "exited-normally" "" "" "" "" "" "finished exec continue" } -mi_send_resuming_command "exec-continue" "continue (2)" - -mi_expect_stop "exited-normally" "" "" "" "" "" "finished exec continue (2)" - mi_gdb_exit -- 2.34.0