From: Luis Machado Date: Fri, 19 Jun 2026 08:16:55 +0000 (-0500) Subject: Log gdb_do_cache misses only, not hits X-Git-Url: http://git.ipfire.org/gitweb/?a=commitdiff_plain;ds=inline;p=thirdparty%2Fbinutils-gdb.git 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 --- 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