From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: 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-Spam-Status: No, score=-3.9 required=5.0 tests=BAYES_00,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS,KAM_DMARC_STATUS,NICE_REPLY_A,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS,TXREP autolearn=no 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 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.