From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca (simark.ca [158.69.221.121]) by sourceware.org (Postfix) with ESMTPS id 289613858298 for ; Thu, 10 Nov 2022 17:53:49 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 289613858298 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=simark.ca Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=simark.ca 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 952D31E0CB; Thu, 10 Nov 2022 12:53:48 -0500 (EST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=simark.ca; s=mail; t=1668102828; bh=oTTSBw/GfOH7w8oWNR8IfWBZKYDOnSTQ4oYd0RG8VXk=; h=Date:Subject:To:References:From:In-Reply-To:From; b=aAPDdggiIbhvkPkzPLo/SCrBrL8tXQgKphOhKl/3cFGH4Qw0GXeIDCtfODXj70tfN 18nmOFhnRF2A98uNYQM/WESb4Xb5tbG5uiyKL1dQBvDwPU3JLoIQ2kCuC2cvXRtMj0 TPvGrenBaFKbH5keymeDV3CMhexkhauY78bWEgkE= Message-ID: <24950a15-f7c9-5da7-734c-51e11b6b2089@simark.ca> Date: Thu, 10 Nov 2022 12:53:47 -0500 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.4.1 Subject: Re: [PATCH v2] gdb: make "start" breakpoint inferior-specific Content-Language: en-US To: Pedro Alves , Simon Marchi , gdb-patches@sourceware.org References: <691c5a58-68ae-5fe9-2f3d-34fb7af69ad0@palves.net> <20221108212008.1792090-1-simon.marchi@efficios.com> <47b696c4-6584-8165-0799-5d742132361a@palves.net> <0ebeeb02-db83-53ac-2bcb-05dc92b96316@simark.ca> <1fe7e127-e23a-5563-68e8-47c13f14679e@palves.net> From: Simon Marchi In-Reply-To: <1fe7e127-e23a-5563-68e8-47c13f14679e@palves.net> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-5.1 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,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 11/10/22 12:47, Pedro Alves wrote: > On 2022-11-10 5:33 p.m., Simon Marchi wrote: > >>>> +proc do_test {} { >>>> + # With remote, to be able to start an inferior while another one is >>>> + # running, we need to use the non-stop variant of the protocol. >>>> + save_vars { ::GDBFLAGS } { >>>> + if { [target_info gdb_protocol] == "extended-remote"} { >>>> + append ::GDBFLAGS " -ex \"maintenance set target-non-stop on\"" >>>> + } >>>> + >>>> + clean_restart ${::binfile_other} >>>> + } >>>> + >>>> + gdb_test "run&" "Starting program: .*" "start background inferior" >>> >>> I was going to point out that if the inferior prints something, this can >>> timeout, as that output would appear after the prompt. I then looked around >>> the tree for "run&" uses, to confirm we are using gdb_test_multiple with that, >>> and found that you just recently added "gdb_test -no-prompt-anchor", for exactly >>> this scenario. :-) I think that should be used here. >> >> Even if, in this case, we know the inferior won't print anything? > > Admitedly it's a bit pedantic, but it seems to me to be safer. Say > someones adds some logging to the program or something. It just looks > like good practice to me to not have an anchor when the inferior is left > running after the prompt is printed. Ack, I will add it. Simon