From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp.polymtl.ca (smtp.polymtl.ca [132.207.4.11]) by sourceware.org (Postfix) with ESMTPS id 1C5BC3858D33 for ; Tue, 10 Jan 2023 20:42:31 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 1C5BC3858D33 Authentication-Results: sourceware.org; dmarc=pass (p=quarantine dis=none) header.from=polymtl.ca Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=polymtl.ca 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 30AKgIja028308 (version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 10 Jan 2023 15:42:23 -0500 DKIM-Filter: OpenDKIM Filter v2.11.0 smtp.polymtl.ca 30AKgIja028308 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=polymtl.ca; s=default; t=1673383343; bh=DVY2ZrgQn1OQDAI3DKHhGtZdobTGj3l6Ge/4ydacjZk=; h=Date:Subject:To:References:From:In-Reply-To:From; b=s5zu+Omv6Go7w4sCI7Sz/l4zhBtiqfUF+ByGNNnMRNavLQJI12BGhl/GDOGOXyPbq DILSzyywciDlzThYZoHrtXKkBm/KEu3Q7LHGnYrMuTHKhsVO+yEZCInlM3ZluFZ5Ir vBtLEevxNhmTKYMduBauRHJ/ahC6/+3Cl+RyGIa8= 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) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPSA id 0E0DD1E110; Tue, 10 Jan 2023 15:42:17 -0500 (EST) Message-ID: Date: Tue, 10 Jan 2023 15:42:17 -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> From: Simon Marchi 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 20:42:18 +0000 X-Spam-Status: No, score=-3038.0 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,GIT_PATCH_0,NICE_REPLY_A,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_PASS,SPF_PASS,TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: On 1/10/23 14:56, Pedro Alves wrote: > On 2023-01-10 3:50 p.m., Simon Marchi wrote: >> >> >> 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? > > No, I was just trying to catch up on patches a bit, and read your patch and noticed > that issue. I was going to reply to the patch directly, but then saw the > follow up discussion and replied there (or rather, here). > >> 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've always found the message/no-message API confusing. It exists on > runto too, and maybe other procs. I was planning to remove it from runto too. > > I think the intention of not issuing PASS by default, was that you can > use gdb_breakpoint to implement other procedures inside lib/gdb.exp. > If gdb_breakpoint starts issuing a PASS, then an implementation detail > of such procedures starts being visible, by ending up with two PASSes for > each call of the procedure that happens to use gdb_breakpoint, one for > gdb_breakpoint, and one for the caller procedure proper. And do you think this is important? Personally, I don't think the multiple PASSes is a problem. Simon