From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id PEbnA7deyGiDtAUAWB0awg (envelope-from ) for ; Mon, 15 Sep 2025 14:45:11 -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=eFFgsbuk; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id E631E1E0BA; Mon, 15 Sep 2025 14:45:10 -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 428E11E04C for ; Mon, 15 Sep 2025 14:45:10 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id B2E7C3858407 for ; Mon, 15 Sep 2025 18:45:09 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org B2E7C3858407 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=eFFgsbuk 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 7C7433858C24 for ; Mon, 15 Sep 2025 18:44:18 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 7C7433858C24 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 7C7433858C24 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=1757961858; cv=none; b=Tjoc1vmRbw1G6BumqPGcw0B/kFVkTZsPwRuQZeCUTgfF9AduH2h9zaxitac014cOyQYl9qxAXW1AWgEFGKTT/aOJQxZqpfO55q43xe8+i40pL6twFqlbj7U6uT0HDGO62oF9fHJafTPwEAIBNHm/qZRuF1OR7hlMBR6iekSbaN8= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1757961858; c=relaxed/simple; bh=UffaqxY18b60S6CnJGis2yTMFZeCJtVyi4fnpSq27uA=; h=DKIM-Signature:Date:From:To:Subject:Message-ID:MIME-Version; b=HInRvaW/eRrmyfA0U5Yn3zdA33EuN3bgBHPA2Aok3IFZPxVrWLifyW+f3xMXPKR7B26UCr1NuazV6qL//ZE1xAPOqYt4Fr9Ho9sXj+bPJ9JIZ9eImRGwWw0dMNf0zlQ2wKIWnTYWbuXwv2C6QSDuA6TiXTsFOZVP+6e+UGd0pnU= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 7C7433858C24 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1757961858; 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=Bgj/hdtoQ9NLhYlAEYbAns1VwiD8PvxZS+YKIIT7P4M=; b=eFFgsbukvOzqmUeCJlOP/+T1unuMOX6DXpBNUvB9ef7P51vEOZUZq9Gn7RUCoJ6w9RK25t YvHZPzAe2y50yycAnELgI/tTF69xARcWAy/3IBxCVF7fv+BDwMoLuwYLMHzo9T9XaoeymQ rSqyiqkROGIrAx7A1jlwqVC02fKunhw= Received: from mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-553-oHfkjXQqNXOay8IAJlTmyQ-1; Mon, 15 Sep 2025 14:44:17 -0400 X-MC-Unique: oHfkjXQqNXOay8IAJlTmyQ-1 X-Mimecast-MFC-AGG-ID: oHfkjXQqNXOay8IAJlTmyQ_1757961856 Received: from mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.4]) (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-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 1E3B718002C3; Mon, 15 Sep 2025 18:44:16 +0000 (UTC) Received: from f41-zbm-amd (unknown [10.22.64.42]) by mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 4B1B130002D0; Mon, 15 Sep 2025 18:44:15 +0000 (UTC) Date: Mon, 15 Sep 2025 11:44:09 -0700 From: Kevin Buettner To: Tom Tromey Cc: gdb-patches@sourceware.org Subject: Re: [PATCH] Remove uses of "eval" from gdb testsuite Message-ID: <20250915114409.07f7be81@f41-zbm-amd> In-Reply-To: <87frcnmufe.fsf@tromey.com> References: <20250913194016.930447-1-tom@tromey.com> <20250915111518.0cefd70b@f41-zbm-amd> <87frcnmufe.fsf@tromey.com> Organization: Red Hat MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.4 X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: jHLEJY8GeTFEGNcnVe_qIG33EmNfkpM0jebQZaInnL8_1757961856 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 Mon, 15 Sep 2025 12:39:49 -0600 Tom Tromey wrote: > >> 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} { > > Kevin> Is the {*} expansion needed here? I've looked at the callers of > Kevin> dap_match_values and the key is always a plain string, so the splatted > Kevin> version is equivalent to 'dict get $d $key'. The splat would only > Kevin> matter if 'key' could be a list for a nested dictionary lookup. > > Yeah, many invocations use this feature, e.g.: > > dap_match_values "argc in function" [lindex $obj 0] \ > "body result" 3 > > Here 'args' ends up as the list {"body result" 3} and then the first > call to "dict get" is passed "body result" as the key -- but this is > trying to fetch a sub-key. Ah, okay. I clearly didn't look closely enough. Thanks for the explanation. Reviewed-by: Kevin Buettner Kevin