From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by sourceware.org (Postfix) with ESMTPS id A5F8F382AA8D for ; Mon, 3 Jun 2024 18:17:10 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org A5F8F382AA8D 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 A5F8F382AA8D 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=1717438633; cv=none; b=odpMEtWVlIQGCVxi13Z53NYr7YdJEP/MxlnWZzcW8L/LI09R8lQX7ouUKSzRKt7P2ggqVCD+aBugbf5htBKJG6m2YcyY2Ot8FX2UBxKDbOnOqfEvDpTcEKjNm6Y9wTj+BZLK+xYC+vSlEhpAGv2anv2J6MmY7lqkIebpxmH+TQ4= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1717438633; c=relaxed/simple; bh=twngJ8BsMSev5T0JJ7xFLVHe5McbcUp8syDGZvPIvUc=; h=DKIM-Signature:From:To:Subject:Date:Message-Id:MIME-Version; b=YB07n8Xr6C3AGZyRvP5wsnLke/NZCNOoGcEsb3HVjvza0E9RkJb9c43TEoOhm2eKrMzh+DcX/1HrnNSayo873vn1E7W7E3UPH3bx+YWjoZ4jgol7Gjqa2Ijw1I0BkZA6hFPL0uiAUSHS9AuqmqG5HCbWzNMRylU8lCM3xy7tU88= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1717438630; 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=oujXuJLo2CVEtkhQrZzVD3aKyZV9PPjGcWoFaiWTR1A=; b=Ty4r5h3jsllt9pgMeFpD0NUtNo5NI0zla/KiWb1spx5gAWMIn2cjG2AdPxvUUBvr/xVma9 qjZ7Z+i2dFFbytr9mtyGmo6WBfXxGHKZPJdr+OA4t8GMsAGJg5i3QRvr4KuzmJdiMf3cjb 8GbKnDLi4E7qTax4TcC75KQKUxWv+FI= Received: from mail-wr1-f69.google.com (mail-wr1-f69.google.com [209.85.221.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-644-1eIiBOQHPvy56cQvxIusTA-1; Mon, 03 Jun 2024 14:17:07 -0400 X-MC-Unique: 1eIiBOQHPvy56cQvxIusTA-1 Received: by mail-wr1-f69.google.com with SMTP id ffacd0b85a97d-35dcd39c6ebso2827249f8f.1 for ; Mon, 03 Jun 2024 11:17:07 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1717438626; x=1718043426; 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=oujXuJLo2CVEtkhQrZzVD3aKyZV9PPjGcWoFaiWTR1A=; b=WOfV1aaeXBRdD0CQDrSlnLRfuXtKNV5tVkAGeCcsEY+XV8dxDSvohgAKU0a2zbTJQB TaG5dg8X+IxTsMtLpav+0XrHcASQhyZkC0g9iZE9EwsUqd4YAxUkJ+4dPRCQ7P2+ODLv bxkf5AbRsx/FX9pRHlqnzjiTS6YCjFNq+KG3KtSA0E31575nl/leY3CpcP9A1mGjGasm hvdPOwzCRZchZKe1smq44/2Xe2UNVb7gS6JOWQL3xUtgEscKau59OqixugLJEt5efCGM dcm15DFSfZdzkoDK9XnzrTYkziwGH24sXaRb5TkWruNYbJrUrGDnWSCjH8E2cSYQ3Hg0 tW9g== X-Gm-Message-State: AOJu0Yz0eATXFpY6qRg2BmU4fMLc8Z+qsf7ioDP2F1JR3lYbDZDr+lRa htjF9tpRkKcZvNLY6F/1YTlmiGDiomCFCWCkLuyFBoWFgAeZ5jMoLsC5N5krmDjaDM9K0ZVZwjU pPNMJxDKcFnpWs+KFUR+8ip7kLbd47Q/5oQOKRrR6+c9maim83sTiQlHtazqvqnBunrIUD/pfyz XCUa13R1a8EyLzUWcD5xuFYJuL2facbfuBzHUrA535ZMc= X-Received: by 2002:adf:e805:0:b0:35e:537c:b1ac with SMTP id ffacd0b85a97d-35e7c59148fmr367508f8f.34.1717438626476; Mon, 03 Jun 2024 11:17:06 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFiODxpeQ8+rAd7ylIecnKNTfFsOf8h6pM3CcUmbSEB+InTCEeImNhR06sn4C6UM9UnNUGtSQ== X-Received: by 2002:adf:e805:0:b0:35e:537c:b1ac with SMTP id ffacd0b85a97d-35e7c59148fmr367487f8f.34.1717438625966; Mon, 03 Jun 2024 11:17:05 -0700 (PDT) Received: from localhost (92.40.185.136.threembb.co.uk. [92.40.185.136]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-42133227f8asm108518635e9.19.2024.06.03.11.17.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 03 Jun 2024 11:17:05 -0700 (PDT) From: Andrew Burgess To: gdb-patches@sourceware.org Cc: Andrew Burgess Subject: [PATCH 3/4] gdb/testsuite: restructure gdb_data_cache (lib/cache.exp) Date: Mon, 3 Jun 2024 19:16:54 +0100 Message-Id: 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=-8.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,GIT_PATCH_0,RCVD_IN_ABUSEAT,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL,RCVD_IN_SBL_CSS,SPF_HELO_NONE,SPF_NONE,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 List-Id: In a later 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 ',value' suffix to the gdb_data_cache keys. In later commits I'll add additional entries with different suffixes. 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