From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm1-f51.google.com (mail-wm1-f51.google.com [209.85.128.51]) by sourceware.org (Postfix) with ESMTPS id E9905385624D for ; Wed, 18 May 2022 12:36:28 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org E9905385624D 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-wm1-f51.google.com with SMTP id m62so1051855wme.5 for ; Wed, 18 May 2022 05:36:28 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:date:mime-version:user-agent:subject :content-language:to:cc:references:from:in-reply-to :content-transfer-encoding; bh=gopJ7cMkZ6xZZa4gPK597/Z/BW8jv9f4RApmWdf+dkk=; b=DUZWSsDH29ABbd8RLlVQMiAN0Hm9Q0MeF194ap4gfohRwlKeW/f+TJDakG9UPW0lHx KG5mMZMUqPjcPAn2TrQ42tk1b91Zft6ksuAJf6LGt/DhbeXGodURa9uWxJL1o5VyVO5A Eb7lM8Cch6+4+lZmHlvj79+45GgNhURY6djyf7oMy7K9YeAjzpMEoUWfKds8uOJo3VO/ V132vH9Nak379iHPIK2DZyIoSanW9w5z22VX10AfKDU54T4XBp0PeDDSpBikU6OL5q15 0akamD5iauYIbb6+c+/4/G+EEgNwZqg/tM2vyEKatw8ZHcS5clwxQO3IYYVYmlheMhOI 4ZCw== X-Gm-Message-State: AOAM533UVuol7VU/pPx5MryED3TGGkXdGs/DC1peJMPixtMcXgZC4GUK iHmK1zTs2id0zDPPTgoMQIY= X-Google-Smtp-Source: ABdhPJzMBCgOMNnshTgjxUy5jMxg5gED6BhxmArJpgNgkJpvf4D1tf8XVrUDxuvO16bDmcPld2USPQ== X-Received: by 2002:a05:600c:3b04:b0:394:6150:db8f with SMTP id m4-20020a05600c3b0400b003946150db8fmr25626592wms.183.1652877387762; Wed, 18 May 2022 05:36:27 -0700 (PDT) Received: from ?IPV6:2001:8a0:f924:2600:209d:85e2:409e:8726? ([2001:8a0:f924:2600:209d:85e2:409e:8726]) by smtp.gmail.com with ESMTPSA id c3-20020adfa703000000b0020d012692dbsm2347235wrd.18.2022.05.18.05.36.26 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 18 May 2022 05:36:26 -0700 (PDT) Message-ID: Date: Wed, 18 May 2022 13:36:25 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.9.0 Subject: Re: [pushed] Support -prompt and -lbl in gdb_test (Re: [PATCH 5/5] Make gdb_test's question non-optional if specified) Content-Language: en-US To: Tom de Vries , Tom Tromey Cc: gdb-patches@sourceware.org References: <20220330192929.3161015-1-pedro@palves.net> <20220330192929.3161015-6-pedro@palves.net> <87o7zxeaa6.fsf@tromey.com> <87sfp7kc78.fsf@tromey.com> <8def622c-5396-d1e1-dfbb-a5732dd8183a@palves.net> From: Pedro Alves In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-3.5 required=5.0 tests=BAYES_00, BODY_8BITS, 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, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org 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: , X-List-Received-Date: Wed, 18 May 2022 12:36:30 -0000 On 2022-05-18 13:15, Tom de Vries wrote: > On 5/18/22 13:01, Pedro Alves wrote: >> -    if [llength $args]>2 then { >> -    set message [lindex $args 2] >> -    } else { >> -    set message [lindex $args 0] >> +    if { $message == "" } { >> +    set message $command >>       } > > This seems to cause: > ... > PATH: gdb.ada/exec_changed.exp: shell mv /home/vries/gdb_versions/devel/build/gdb/testsuite/outputs/gdb.ada/exec_changed/first /home/vries/gdb_versions/devel/build/gdb/testsuite/outputs/gdb.ada/exec_changed/common > PATH: gdb.ada/exec_changed.exp: shell mv /home/vries/gdb_versions/devel/build/gdb/testsuite/outputs/gdb.ada/exec_changed/common /home/vries/gdb_versions/devel/build/gdb/testsuite/outputs/gdb.ada/exec_changed/first > PATH: gdb.ada/exec_changed.exp: shell mv /home/vries/gdb_versions/devel/build/gdb/testsuite/outputs/gdb.ada/exec_changed/second /home/vries/gdb_versions/devel/build/gdb/testsuite/outputs/gdb.ada/exec_changed/common > PATH: gdb.ada/exec_changed.exp: shell touch /home/vries/gdb_versions/devel/build/gdb/testsuite/outputs/gdb.ada/exec_changed/common > PATH: gdb.ada/exec_changed.exp: shell touch /home/vries/gdb_versions/devel/build/gdb/testsuite/outputs/gdb.ada/exec_changed/first > ... > because the interpretation of message "" changed: > ... > gdb_test "shell mv ${binfile} ${common_binfile}" ".*" "" > ... Hmm... Yeah... We could revert most of the changes to gdb_test and just keep the parse_args part. However, IMO the old behavior is a misfeature, though. I think tests should always have a name. E.g., if such a test hits an internal error, what message would be used? The documentation of the option even says that if message is omitted, use the command string as message: # MESSAGE is an optional message to be printed. If this is # omitted, then the pass/fail messages use the command string as the # message. (If this is the empty string, then sometimes we don't # call pass or fail at all; I don't understand this at all.) Also, gdb_test_multiple doesn't a distinction between explicit "" message and not specified message, the only way to end up with an empty message is if command is empty as well. So AFAICS, this change (inadvertently) made gdb_test and gdb_test_multiple behave the same in this respect. So how about we just fix the affected gdb_test invocations?