From cb4f21e164991ca3748d8b3031244e40f0a7a821 Mon Sep 17 00:00:00 2001 From: Luis Machado Date: Fri, 19 Jun 2026 03:16:55 -0500 Subject: [PATCH] Log gdb_do_cache misses only, not hits The verbose -log in gdb_do_cache fired unconditionally on every call, including cache hits. With many tests calling gdb_caching_procs like get_compiler_info_1 per compilation, this produced dozens of repeated identical lines per test file in the log, like so: gdb_do_cache: get_compiler_info_1 ( c ) gdb_do_cache: get_compiler_info_1 ( c ) gdb_do_cache: get_compiler_info_1 ( c ) gdb_do_cache: get_compiler_info_1 ( c ) gdb_do_cache: get_compiler_info_1 ( c ) gdb_do_cache: get_compiler_info_1 ( c ) gdb_do_cache: get_compiler_info_1 ( c ) gdb_do_cache: get_compiler_info_1 ( c ) Move the log to just before actual computation, after both the in-memory and on-disk cache checks. This helps keep the logs clean. Reviewed-By: Guinevere Larsen --- gdb/testsuite/lib/cache.exp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/gdb/testsuite/lib/cache.exp b/gdb/testsuite/lib/cache.exp index 71688ee373e..1ba8c881716 100644 --- a/gdb/testsuite/lib/cache.exp +++ b/gdb/testsuite/lib/cache.exp @@ -103,8 +103,6 @@ proc gdb_do_cache {name args} { global gdb_data_cache objdir global GDB_PARALLEL - verbose -log "gdb_do_cache: $name ( $args )" - # Normally, if we have a cached value, we skip computation and return # the cached value. If set to 1, instead don't skip computation and # verify against the cached value. @@ -195,6 +193,7 @@ proc gdb_do_cache {name args} { set old_gdb_nested_caching_proc_calls $::gdb_nested_caching_proc_calls set ::gdb_nested_caching_proc_calls {} + verbose -log "gdb_do_cache: $name ( $args )" set real_name gdb_real__$name set gdb_data_cache(${cache_name},value) [gdb_do_cache_wrap $real_name {*}$args] set gdb_data_cache(${cache_name},exit) $::gdb_exit_called -- 2.47.3