From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id OIDAHSHNs2GmYwAAWB0awg (envelope-from ) for ; Fri, 10 Dec 2021 16:56:49 -0500 Received: by simark.ca (Postfix, from userid 112) id 775851F0D0; Fri, 10 Dec 2021 16:56:49 -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.8 required=5.0 tests=BAYES_00,MAILING_LIST_MULTI, NICE_REPLY_A 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 E225A1ECEB for ; Fri, 10 Dec 2021 16:56:48 -0500 (EST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 848853857C71 for ; Fri, 10 Dec 2021 21:56:48 +0000 (GMT) Received: from mail-wr1-f43.google.com (mail-wr1-f43.google.com [209.85.221.43]) by sourceware.org (Postfix) with ESMTPS id 2492C3857C75 for ; Fri, 10 Dec 2021 21:56:15 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 2492C3857C75 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=palves.net Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-wr1-f43.google.com with SMTP id j3so17265125wrp.1 for ; Fri, 10 Dec 2021 13:56:15 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:date:mime-version:user-agent:subject :content-language:to:references:from:in-reply-to :content-transfer-encoding; bh=n5XaMoUeE967SJgW7ByzgZs9G+861nNZQEINE81yxUY=; b=pGLVGIhZPxAcnUMSG8FAQ66iJS5q53t9SsN2EPhZWcB0mOsVaHJgi5/qpks0UjnX3f VeGPZqJCXJAfEGdfwwfp80xKclTs1fUnlUiM/xb63RAvGfSJ4p7T4alBtWTHtdv9+Q+J Kq5yPumWRiNnmvMDWuB+a1Siix4r49uQ0E6PDN+pxTDkt36Ose+Tsnqq0WqdxVoZAHfn ok96q2Kd8oAWA71v7L9YHIEpR6emmgFOZSKjLOVjMlRVg0ZByvVV7PpvfwXslYqhzkMC 2av5dbU6gkLFt8j8789kxUkAGzIOLBoy2YRDoQMPbMHaxnKFHxT9j+zx9vY28lBknfRb cVDw== X-Gm-Message-State: AOAM531TKuymjVQROxxWF4TFF/KUV0fKWtJdN5n3+u5xHVA80E0V5eXA gc+WWAr9bD7beFnJR4nFW7c= X-Google-Smtp-Source: ABdhPJyDjj3sDSZSeyJ16EXapCkcbuyVWJat8+l7IcU0Wysf584oRW/pp36icnlbfkhAuMezEOLubg== X-Received: by 2002:adf:d1c1:: with SMTP id b1mr16484137wrd.204.1639173374184; Fri, 10 Dec 2021 13:56:14 -0800 (PST) Received: from ?IPV6:2001:8a0:f912:1a00:d3db:ac91:4b9e:1449? ([2001:8a0:f912:1a00:d3db:ac91:4b9e:1449]) by smtp.gmail.com with ESMTPSA id c1sm3537139wrt.14.2021.12.10.13.56.12 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 10 Dec 2021 13:56:13 -0800 (PST) Message-ID: <82c036ab-e9ee-ce09-498e-c419c84a58cd@palves.net> Date: Fri, 10 Dec 2021 21:56:12 +0000 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.3.2 Subject: Re: [PATCH 08/12] gdb/testsuite: Remove duplicates from gdb.mi/mi-nonstop-exit.exp Content-Language: en-US To: Lancelot SIX , gdb-patches@sourceware.org References: <20211126230038.103225-1-lsix@lancelotsix.com> <20211126230038.103225-9-lsix@lancelotsix.com> From: Pedro Alves In-Reply-To: <20211126230038.103225-9-lsix@lancelotsix.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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: , Errors-To: gdb-patches-bounces+public-inbox=simark.ca@sourceware.org Sender: "Gdb-patches" On 2021-11-26 23:00, Lancelot SIX via Gdb-patches wrote: > 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. > > 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. > > Tested on x86_64-linux. > --- > gdb/testsuite/gdb.mi/mi-nonstop-exit.exp | 22 +++++++--------------- > 1 file changed, 7 insertions(+), 15 deletions(-) > > diff --git a/gdb/testsuite/gdb.mi/mi-nonstop-exit.exp b/gdb/testsuite/gdb.mi/mi-nonstop-exit.exp > index 99ac92f15a3..740856ca822 100644 > --- a/gdb/testsuite/gdb.mi/mi-nonstop-exit.exp > +++ b/gdb/testsuite/gdb.mi/mi-nonstop-exit.exp > @@ -39,24 +39,16 @@ 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} { > + if { [mi_runto_main] < 0 } { > + continue > + } > > -# Run the program again. > + mi_send_resuming_command "exec-continue" "continue" > > -mi_delete_breakpoints > + mi_expect_stop "exited-normally" "" "" "" "" "" "finished exec continue" > > -if { [mi_runto_main] < 0 } { > - continue > + mi_delete_breakpoints > } > > -mi_send_resuming_command "exec-continue" "continue (2)" > - > -mi_expect_stop "exited-normally" "" "" "" "" "" "finished exec continue (2)" > - > mi_gdb_exit >