From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id rn2iOmiJvWNrsxMAWB0awg (envelope-from ) for ; Tue, 10 Jan 2023 10:51:04 -0500 Received: by simark.ca (Postfix, from userid 112) id DD9261E128; Tue, 10 Jan 2023 10:51:04 -0500 (EST) Authentication-Results: simark.ca; dkim=pass (1024-bit key; secure) header.d=sourceware.org header.i=@sourceware.org header.a=rsa-sha256 header.s=default header.b=qNXLHwqq; dkim-atps=neutral X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-6.3 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,NICE_REPLY_A, RCVD_IN_DNSWL_MED,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 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 7DE8C1E0D3 for ; Tue, 10 Jan 2023 10:51:04 -0500 (EST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 11B4B38555A2 for ; Tue, 10 Jan 2023 15:51:04 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 11B4B38555A2 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1673365864; bh=gwHrcgdT+dG3BP0D3YL9FmMPNk7EyZ0YX/7WHU5ArC8=; h=Date:Subject:To:References:In-Reply-To:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=qNXLHwqq2gbmzxrhy17bRJiIXiS/LaxEa3ReMyCyA6ZnYBiB17dhpG7AF3j7+8ntf 1hksaBFtmTkHvjucTyRLg94d6QLEhKPOGv+rcr5WwWfjQvlF45Ln/BI5uA0pKr7O3H ukD/y+BbcpaS/fiZfSiAN1HNZvysbKbfP5Fferv4= Received: from smtp.polymtl.ca (smtp.polymtl.ca [132.207.4.11]) by sourceware.org (Postfix) with ESMTPS id 16B05385703F for ; Tue, 10 Jan 2023 15:50:42 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 16B05385703F Received: from simark.ca (simark.ca [158.69.221.121]) (authenticated bits=0) by smtp.polymtl.ca (8.14.7/8.14.7) with ESMTP id 30AFoTKM024538 (version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 10 Jan 2023 10:50:34 -0500 DKIM-Filter: OpenDKIM Filter v2.11.0 smtp.polymtl.ca 30AFoTKM024538 Received: from [10.0.0.11] (unknown [217.28.27.60]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by simark.ca (Postfix) with ESMTPSA id 42B0C1E0D3; Tue, 10 Jan 2023 10:50:29 -0500 (EST) Message-ID: Date: Tue, 10 Jan 2023 10:50:28 -0500 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.6.1 Subject: Re: [PATCH] gdb: use gdb_test_multiple in gdb_breakpoint Content-Language: en-US To: Pedro Alves , Tom de Vries , gdb-patches@sourceware.org References: <20230103192216.108444-1-simon.marchi@polymtl.ca> <315f1d7a-a948-5512-fd89-a40d7a25e937@polymtl.ca> In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Poly-FromMTA: (simark.ca [158.69.221.121]) at Tue, 10 Jan 2023 15:50:29 +0000 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: Simon Marchi via Gdb-patches Reply-To: Simon Marchi Errors-To: gdb-patches-bounces+public-inbox=simark.ca@sourceware.org Sender: "Gdb-patches" On 1/10/23 10:33, Pedro Alves wrote: > On 2023-01-05 4:28 p.m., Simon Marchi via Gdb-patches wrote: > >> --- >> gdb/testsuite/lib/gdb.exp | 6 ++++++ >> 1 file changed, 6 insertions(+) >> >> diff --git a/gdb/testsuite/lib/gdb.exp b/gdb/testsuite/lib/gdb.exp >> index e17eace4cb13..af538e5c8fbd 100644 >> --- a/gdb/testsuite/lib/gdb.exp >> +++ b/gdb/testsuite/lib/gdb.exp >> @@ -657,6 +657,12 @@ proc gdb_breakpoint { linespec args } { >> send_gdb "$pending_response\n" >> exp_continue >> } >> + -re "$gdb_prompt $" { >> + if { $print_fail } { >> + fail $test_name >> + } >> + return 0 >> + } >> } > > The other removed "-re" cases also considered $print_fail, so if their replacement > inside gdb_test_multiple is hit, they'll produce a FAIL. Was that intended? > Should we instead add a "-nofail" option to gdb_test / gdb_test_multiple ? Good point, this is a change in behavior. Does this change cause you an unexpected FAIL in practice? I was actually planning on removing that message / no-message option to gdb_breakpoint [1] to simplify it. I don't see any use for the current behavior, I'd rather have it log a test result all the time. I can kind of see when that would maybe be useful: if you wanted to set a breakpoint, and it could legitimately not work (you could do something with gdb_breakpoint's return value). But you could also use the break command directly, like many places do already, so it's not really needed. Anyway, all of this to say that I could fix what you pointed out by pruning / simplifying code rather than adding more. Simon [1] https://review.lttng.org/c/binutils-gdb/+/7158/6