From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id 6G67Cy05bWPbmxYAWB0awg (envelope-from ) for ; Thu, 10 Nov 2022 12:47:25 -0500 Received: by simark.ca (Postfix, from userid 112) id 2E1A51E124; Thu, 10 Nov 2022 12:47:25 -0500 (EST) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-6.2 required=5.0 tests=BAYES_00,MAILING_LIST_MULTI, NICE_REPLY_A,RCVD_IN_DNSWL_MED autolearn=unavailable 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 EE1861E0D3 for ; Thu, 10 Nov 2022 12:47:24 -0500 (EST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id A7F3F388552B for ; Thu, 10 Nov 2022 17:47:24 +0000 (GMT) Received: from mail-wr1-f41.google.com (mail-wr1-f41.google.com [209.85.221.41]) by sourceware.org (Postfix) with ESMTPS id 8568D385840A for ; Thu, 10 Nov 2022 17:47:10 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 8568D385840A 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-f41.google.com with SMTP id bk15so3323512wrb.13 for ; Thu, 10 Nov 2022 09:47:10 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:content-language:in-reply-to:mime-version :user-agent:date:message-id:from:references:to:subject :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=AfHL8UISP1H5tUyYH+hebhQOI2oXlWvOKI9cr1cHppk=; b=rRlgqy9eDPZZGoAnVCtPePQ25oH7CbwfR07R5RN2LDjFXyFKSTmdGDmrf6qRnDV9V2 WCHqjhUULnXzNQrHt/4+bvHI+VNDK4vxMDlwgEOFi63rFXwk7hyZ/A79wO9xFpVOrXpI aoCUyQ5qOQIHEMCqLCl/2r+10gEcqCqg7vzok7so1JGp0GF43Io0wMdL3LbxQjpDSoNH D0M09S4jfJIYj5WJDdElg/8cEb2oFlmR5C7pZH2MX1kY6O0XrTsFcuysNzMtOsW1Kx8L GQgA9GkGcUCSh73gLQZbVe6z2idnauQlV8I2/7VpM2SoB5s3OxXTOvCg/aLGdpFp/nKX SOGA== X-Gm-Message-State: ACrzQf2cRDJh7W/Aybv7qQtylr7P3che+pWKmkQxRkppyO+viMZdqD/S A9rIyJN0EvGzO2sxIgQ94Lzv5BZArhY= X-Google-Smtp-Source: AMsMyM4uRr8KItoOOSAUtJDlIhwy1RiQU9zRiSQCGVloKk6AysnPAGQsKPg6DDzv0iBDX59CPUTfYg== X-Received: by 2002:a5d:6b02:0:b0:236:d484:2d01 with SMTP id v2-20020a5d6b02000000b00236d4842d01mr35129172wrw.623.1668102428037; Thu, 10 Nov 2022 09:47:08 -0800 (PST) Received: from ?IPv6:2001:8a0:f93a:3b00:e038:5cdc:b8bf:4653? ([2001:8a0:f93a:3b00:e038:5cdc:b8bf:4653]) by smtp.gmail.com with ESMTPSA id s21-20020a1cf215000000b003a6a3595edasm200501wmc.27.2022.11.10.09.47.07 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 10 Nov 2022 09:47:07 -0800 (PST) Subject: Re: [PATCH v2] gdb: make "start" breakpoint inferior-specific To: Simon Marchi , 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> From: Pedro Alves Message-ID: <1fe7e127-e23a-5563-68e8-47c13f14679e@palves.net> Date: Thu, 10 Nov 2022 17:47:06 +0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.10.1 MIME-Version: 1.0 In-Reply-To: <0ebeeb02-db83-53ac-2bcb-05dc92b96316@simark.ca> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit 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 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.