From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id OMdoGN9XyGjZrQUAWB0awg (envelope-from ) for ; Mon, 15 Sep 2025 14:15:59 -0400 Authentication-Results: simark.ca; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=i9ziMp5O; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id 4AE441E04C; Mon, 15 Sep 2025 14:15:59 -0400 (EDT) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-25) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-3.4 required=5.0 tests=ARC_SIGNED,ARC_VALID,BAYES_00, DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED,RCVD_IN_VALIDITY_CERTIFIED_BLOCKED, RCVD_IN_VALIDITY_RPBL_BLOCKED,RCVD_IN_VALIDITY_SAFE_BLOCKED autolearn=ham autolearn_force=no version=4.0.1 Received: from server2.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 ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id 9AF961E04C for ; Mon, 15 Sep 2025 14:15:58 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 2C2E63858407 for ; Mon, 15 Sep 2025 18:15:58 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 2C2E63858407 Authentication-Results: sourceware.org; dkim=pass (1024-bit key, unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=i9ziMp5O Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by sourceware.org (Postfix) with ESMTP id 106B93858C40 for ; Mon, 15 Sep 2025 18:15:26 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 106B93858C40 Authentication-Results: sourceware.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 106B93858C40 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=170.10.129.124 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1757960126; cv=none; b=LDr3u04P8PvPQhDKhYvLhf/p9KLXsv9mArERI6KNP0aiQ4cDl6tvcx5ANL+LaNBznJosTFz1aqECwauMX50MWCMVft2vmsB9sLCywIUCCblF4UxoUrZwHWmLy+oej7dqXFl6aVvmQ+jd0UWBtWHPFOn1FT86qGPsj/L7i/3gFOE= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1757960126; c=relaxed/simple; bh=5LNl+ayFJtY94MIolG7+HJvhG6IWTfILGieSFMIF6lc=; h=DKIM-Signature:Date:From:To:Subject:Message-ID:MIME-Version; b=PrAik74q6fqWstUpWUQzcj0bnjza3vIibXYR3h5cLf7Jcr6RaNdI8CPssOQp0uZELIEa1zjHiuuTdtyTLTyHt5j1mZqQtUZTksvCnaUmEjr2ggTQtMwMOfI8N95CmvnB9HWfCS0GPopB/nn9RWyIskeqCaPTYu6E7XEEReS9Cno= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 106B93858C40 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1757960125; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=P8QsQCIIiobmm8ar+dRYUY1qcJjBkZSEf82xfqAQTV4=; b=i9ziMp5O2o1zNrVgV4qxd3y+P0zLujeHC+ijLicMpJ0zycWudE7Rx7TTOnFO1emQQ8Hc3d 7THV7mmuXtIMLTM1cIcstdF4zwVPzSCz1cXWHv63NQv7iiX142bx478TaCV5W8/eiV212D uTj6U7XEPbohjnEiIsW5GRtXZ3ZeE+g= Received: from mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-631-XwWKCF7hOy6IWL-JCSE9ig-1; Mon, 15 Sep 2025 14:15:24 -0400 X-MC-Unique: XwWKCF7hOy6IWL-JCSE9ig-1 X-Mimecast-MFC-AGG-ID: XwWKCF7hOy6IWL-JCSE9ig_1757960123 Received: from mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.93]) (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 mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 8EA871944F03; Mon, 15 Sep 2025 18:15:23 +0000 (UTC) Received: from f41-zbm-amd (unknown [10.22.64.42]) by mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id B9CB018003FC; Mon, 15 Sep 2025 18:15:22 +0000 (UTC) Date: Mon, 15 Sep 2025 11:15:18 -0700 From: Kevin Buettner To: gdb-patches@sourceware.org Cc: Tom Tromey Subject: Re: [PATCH] Remove uses of "eval" from gdb testsuite Message-ID: <20250915111518.0cefd70b@f41-zbm-amd> In-Reply-To: <20250913194016.930447-1-tom@tromey.com> References: <20250913194016.930447-1-tom@tromey.com> Organization: Red Hat MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.93 X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: 1SXmp7JQWFllRgbIMExq7xeCBHLat5wC2vjLPXXPiVk_1757960123 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.30 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 On Sat, 13 Sep 2025 13:40:15 -0600 Tom Tromey wrote: > This patch removes a lot of uses of the Tcl "eval" proc from the gdb > test suite. In most cases the {*} "splat" expansion is used instead. > > A few uses of eval remain, primarily ones that were more complicated > to untangle. > > In a couple of tests I also replaced some ad hoc code with > string_to_regexp. I've looked it over. LGTM, though I do have one question... > diff --git a/gdb/testsuite/lib/dap-support.exp > b/gdb/testsuite/lib/dap-support.exp index d61b1c47f3c..3f0f75ab0ba 100644 > --- a/gdb/testsuite/lib/dap-support.exp > +++ b/gdb/testsuite/lib/dap-support.exp > @@ -443,7 +443,7 @@ proc dap_search_output {name rx events} { > # key/value pairs given in ARGS. NAME is used as the test name. > proc dap_match_values {name d args} { > foreach {key value} $args { > - if {[eval dict get [list $d] $key] != $value} { > + if {[dict get $d {*}$key] != $value} { Is the {*} expansion needed here? I've looked at the callers of dap_match_values and the key is always a plain string, so the splatted version is equivalent to 'dict get $d $key'. The splat would only matter if 'key' could be a list for a nested dictionary lookup. Kevin