From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id OHyFIIYHpmbJYDQAWB0awg (envelope-from ) for ; Sun, 28 Jul 2024 04:55:34 -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=FKD5SPqi; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id 7FF3B1E0D0; Sun, 28 Jul 2024 04:55:34 -0400 (EDT) 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 5F85A1E0AC for ; Sun, 28 Jul 2024 04:55:32 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id BDCC13858CDB for ; Sun, 28 Jul 2024 08:55:31 +0000 (GMT) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by sourceware.org (Postfix) with ESMTP id 941ED3858CDB for ; Sun, 28 Jul 2024 08:55:07 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 941ED3858CDB Authentication-Results: sourceware.org; dmarc=pass (p=none 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 941ED3858CDB Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=170.10.133.124 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1722156909; cv=none; b=ehYbqBXtNIIdeP803WQzKBuSoZ+WkpL3UKotrn/ylMtYijFJQRb0PAoGXLzrWgOAvrIfpQ3qe56G7V4M9wAHeStDHmxuzORXp0f4R99puQQJDqYp2RlIksLh937klPlTyfXjj242x8cMFtjL7c2eufWR7BPQfzPQzjm019QnjKA= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1722156909; c=relaxed/simple; bh=xk3S8IscFyVvlyTsZMkFJhgEl9fz1SW2GAYSsT5llh0=; h=DKIM-Signature:From:To:Subject:Date:Message-Id:MIME-Version; b=fJs4JRWVjjbThCYYaCZX2QuZRciruD4bSPAZYmMKmxxrhDh/rf9Kplr3GPNvqpmwJBne4gq4AG6qP8aSsHa/PR+pfRFpTp2pX/WPKxgN906LxKE6MEDp6b9/hlVOz3fvtHDP3jqGCYUyueDdrHwzz41aNuz+6ytvKryj3Hz9S3k= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1722156907; 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=dLqbMU4zR+2cSLc2U0rKTP7s6wWaJljmOiHIMcPJynw=; b=FKD5SPqiBTAklCBBtmKjYBt0gkxD9zOHEEhojQyF5dPAFXe+/RlNq+kZTEpBZzJmiNTjpS le1OoZrbz71Tsq3gEpHU8W9S/jbo0T6YYUlZECF09YfGIApY860JoQWqBnb/hI3reZTzO2 t8Or6glADGX7i4DScGvOEZyK5OKnX5o= Received: from mail-wm1-f70.google.com (mail-wm1-f70.google.com [209.85.128.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-648-8aD32ZAMNjGCcW5CWxX1vw-1; Sun, 28 Jul 2024 04:55:06 -0400 X-MC-Unique: 8aD32ZAMNjGCcW5CWxX1vw-1 Received: by mail-wm1-f70.google.com with SMTP id 5b1f17b1804b1-4280d8e685eso9208105e9.1 for ; Sun, 28 Jul 2024 01:55:05 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1722156903; x=1722761703; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=dLqbMU4zR+2cSLc2U0rKTP7s6wWaJljmOiHIMcPJynw=; b=mwOY617rdnax9G/aW7nSMJjCXGgxUyodWbCiMeTjF/KDZjLwxQqI8wLMeNBNj84W30 geEOk6Qx0zjGKDQCx4OPd85t25REY1Dzxd181BAzzTpIOIfuqCwDMWIC5MNpHSznkNCA j6b9a+StIy1Pbk5Jp0XQRDxbYYUpLpZpEyB26RXZItXwP5wAdr2blY2yXQUbbW+IxLWm kfCe6OQaz1SmZx5maZqMg5qdyDLv5ivg0gD2C0OETpeoQi2U2Xxib5ztAVTG2M2d0nvC kVJxcmvVsYmKe+pWCqUSqjhZYTTeuDeVBXjWp025kWf99bK3aZGhP8ZF9LwRcFc055xq /8Rg== X-Gm-Message-State: AOJu0YymuGUnXmf5SZKXnXD5PPxPuS08L8UCDok0ENDTt98hEyoJ+QWx y0SxFsICRCDj/3VRn+C+M++3cd4TEdYwaijGLn4L8ih5r83VFI8MGvek7LNmHNNvWnSogZojci3 GO/p85GRLma/f8ZEDWX35PlmtuzWkMRcvNT64+2PkwoFV7Clu3tOLcDjdFhI2CqLdCJ6SLra4mq ffI8CAifnMuSn1QrZb3VZlyCZPR2wy5eDUIy48cai9Lqw= X-Received: by 2002:a05:600c:5247:b0:426:62a0:eb6b with SMTP id 5b1f17b1804b1-42811d9461bmr29642985e9.13.1722156903717; Sun, 28 Jul 2024 01:55:03 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGA64vuHEgzNlhT+8+8hF4SnLYu2ni6rQcdflKO1XUM+nvB9pmE4Kq0co06hi3nJZ8Tw8omBQ== X-Received: by 2002:a05:600c:5247:b0:426:62a0:eb6b with SMTP id 5b1f17b1804b1-42811d9461bmr29642925e9.13.1722156903431; Sun, 28 Jul 2024 01:55:03 -0700 (PDT) Received: from localhost ([31.111.84.186]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-42817b91e20sm27927025e9.8.2024.07.28.01.55.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 28 Jul 2024 01:55:01 -0700 (PDT) From: Andrew Burgess To: gdb-patches@sourceware.org Cc: Andrew Burgess Subject: [PUSHED 1/2] gdb/testsuite: restructure gdb_data_cache (lib/cache.exp) Date: Sun, 28 Jul 2024 09:54:57 +0100 Message-Id: <8db172ae38714452e2b36f66988c560c9ce69fc0.1722156763.git.aburgess@redhat.com> X-Mailer: git-send-email 2.25.4 In-Reply-To: References: MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset="US-ASCII"; x-default=true X-Spam-Status: No, score=-11.8 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H4, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_NONE, TXREP 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.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 In the next commit I want to add more information to gdb_data_cache (see lib/cache.exp). Specifically I want to track if the underlying function of a caching proc calls gdb_exit or not. Currently gdb_data_cache is an associative array, the keys of which are the name of the caching proc. In this commit I add a ',value' suffix to the gdb_data_cache keys. In the next commit I'll add additional entries with a different suffix. There should be no noticable changes after this commit, this is just a restructuring. --- gdb/testsuite/lib/cache.exp | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/gdb/testsuite/lib/cache.exp b/gdb/testsuite/lib/cache.exp index 80667349f52..e7b9114058b 100644 --- a/gdb/testsuite/lib/cache.exp +++ b/gdb/testsuite/lib/cache.exp @@ -70,8 +70,8 @@ proc gdb_do_cache {name args} { set cache_name [file join [target_info name] $name {*}$args] set is_cached 0 - if {[info exists gdb_data_cache($cache_name)]} { - set cached $gdb_data_cache($cache_name) + if {[info exists gdb_data_cache(${cache_name},value)]} { + set cached $gdb_data_cache(${cache_name},value) verbose "$name: returning '$cached' from cache" 2 if { $cache_verify == 0 } { return $cached @@ -83,9 +83,9 @@ proc gdb_do_cache {name args} { set cache_filename [make_gdb_parallel_path cache $cache_name] if {[file exists $cache_filename]} { set fd [open $cache_filename] - set gdb_data_cache($cache_name) [read -nonewline $fd] + set gdb_data_cache(${cache_name},value) [read -nonewline $fd] close $fd - set cached $gdb_data_cache($cache_name) + set cached $gdb_data_cache(${cache_name},value) verbose "$name: returning '$cached' from file cache" 2 if { $cache_verify == 0 } { return $cached @@ -95,9 +95,9 @@ proc gdb_do_cache {name args} { } set real_name gdb_real__$name - set gdb_data_cache($cache_name) [gdb_do_cache_wrap $real_name {*}$args] + set gdb_data_cache(${cache_name},value) [gdb_do_cache_wrap $real_name {*}$args] if { $cache_verify == 1 && $is_cached == 1 } { - set computed $gdb_data_cache($cache_name) + set computed $gdb_data_cache(${cache_name},value) if { $cached != $computed } { error [join [list "Inconsistent results for $cache_name:" "cached: $cached vs. computed: $computed"]] @@ -105,15 +105,15 @@ proc gdb_do_cache {name args} { } if {[info exists GDB_PARALLEL]} { - verbose "$name: returning '$gdb_data_cache($cache_name)' and writing file" 2 + verbose "$name: returning '$gdb_data_cache(${cache_name},value)' and writing file" 2 file mkdir [file dirname $cache_filename] # Make sure to write the results file atomically. set fd [open $cache_filename.[pid] w] - puts $fd $gdb_data_cache($cache_name) + puts $fd $gdb_data_cache(${cache_name},value) close $fd file rename -force -- $cache_filename.[pid] $cache_filename } - return $gdb_data_cache($cache_name) + return $gdb_data_cache(${cache_name},value) } # Define a new proc named NAME, with optional args ARGS. BODY is the body of -- 2.25.4