From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id 6ag0Egf2s2oaEDgAWB0awg (envelope-from ) for ; Wed, 23 Sep 2026 11:53:43 -0400 Authentication-Results: simark.ca; dkim=pass (1024-bit key; unprotected) header.d=suse.de header.i=@suse.de header.a=rsa-sha256 header.s=susede2_rsa header.b=nYmuDMst; dkim=pass header.d=suse.de header.i=@suse.de header.a=ed25519-sha256 header.s=susede2_ed25519 header.b=Xrku0xxC; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.a=rsa-sha256 header.s=susede2_rsa header.b=H7y0iUr4; dkim=neutral header.d=suse.de header.i=@suse.de header.a=ed25519-sha256 header.s=susede2_ed25519 header.b=6M/qtodg; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id 463FF1E06B; Wed, 23 Sep 2026 11:53:43 -0400 (EDT) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-25) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-5.4 required=5.0 tests=ARC_SIGNED,ARC_VALID,BAYES_00, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED autolearn=ham autolearn_force=no version=4.0.1 Received: from vm01.sourceware.org (vm01.sourceware.org [IPv6:2620:52:6:3111::32]) (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 7C7471E01F for ; Wed, 23 Sep 2026 11:53:42 -0400 (EDT) Received: from vm01.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id DD9A64BB24EA for ; Wed, 23 Sep 2026 15:53:40 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org DD9A64BB24EA Authentication-Results: sourceware.org; dkim=pass (1024-bit key, unprotected) header.d=suse.de header.i=@suse.de header.a=rsa-sha256 header.s=susede2_rsa header.b=nYmuDMst; dkim=pass header.d=suse.de header.i=@suse.de header.a=ed25519-sha256 header.s=susede2_ed25519 header.b=Xrku0xxC; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.a=rsa-sha256 header.s=susede2_rsa header.b=H7y0iUr4; dkim=neutral header.d=suse.de header.i=@suse.de header.a=ed25519-sha256 header.s=susede2_ed25519 header.b=6M/qtodg Received: from smtp-out1.suse.de (smtp-out1.suse.de [IPv6:2a07:de40:b251:101:10:150:64:1]) by sourceware.org (Postfix) with ESMTPS id 800DD4BAE7DF for ; Wed, 23 Sep 2026 15:53:16 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 800DD4BAE7DF Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=suse.de Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=suse.de ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 800DD4BAE7DF Authentication-Results: sourceware.org; arc=none smtp.remote-ip=2a07:de40:b251:101:10:150:64:1 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1790178796; cv=none; b=CK73T8va2idwHiCmJ7x9mK9/Y+6SxrsUp5mRrsJshG6Ko230Z/EIuvwWFoTFM/UmDNDL1uelXJkxPnwJ1XufEBtqHjftkzGpTcD5y+1jlXUWli2pPbL6oyt1oOW8MZ97Rjcqz5IvntDMxFYLyQsW3VcfpfV1ImjU2YDbFPikLd4= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1790178796; c=relaxed/simple; bh=IpAz1NcAx2P9OKMAVRJ7NMnTLdIbrEMU9zE7KSXugBQ=; h=DKIM-Signature:DKIM-Signature:DKIM-Signature:DKIM-Signature:From: To:Subject:Date:Message-ID:MIME-Version; b=IsQcu+IREG1jM5i/awOhRSuyy5ylOZux/C/1b+hsA5IqjXVT3D62MMbf0dxzYwdtUY045xI/8ry7uwM6I958vHeOPObzAits9jpzFz2Ba1WmohdHWgIlRBNXqTNNf7koBtHut3rfrjWfSMiwZmXntagmagVA2+9LTi2zLINnuqk= ARC-Authentication-Results: i=1; sourceware.org; dkim=pass (1024-bit key, unprotected) header.d=suse.de header.i=@suse.de header.a=rsa-sha256 header.s=susede2_rsa header.b=nYmuDMst; dkim=pass header.d=suse.de header.i=@suse.de header.a=ed25519-sha256 header.s=susede2_ed25519 header.b=Xrku0xxC; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.a=rsa-sha256 header.s=susede2_rsa header.b=H7y0iUr4; dkim=neutral header.d=suse.de header.i=@suse.de header.a=ed25519-sha256 header.s=susede2_ed25519 header.b=6M/qtodg DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 800DD4BAE7DF Received: from imap1.dmz-prg2.suse.org (unknown [10.150.64.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id C7B1A219DB for ; Wed, 23 Sep 2026 15:53:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1790178790; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=5ZpHOllKr91B47qURGkTXZprS2C74/xpy/HfaqAeYw0=; b=nYmuDMstcoH7wsmDWp/VQ4t3bFp83G8XZ3KPqqcseDyfe/PphRw79Yyr16keozoZJHcYGJ jKl0bYAsXwWH5jaHfPf2sn78OO6YrhAV4A2rMC7Ns+hjfgvzzlw7AnRSdpi6w/lNcgLU9x rMQwK2XkEe7K/arSL/IHsJPYpSktivU= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1790178790; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=5ZpHOllKr91B47qURGkTXZprS2C74/xpy/HfaqAeYw0=; b=Xrku0xxC31uCwZB9uEPkd/7MoTuyYdANotOl2s7klrB0RmDTviYQGKXT1E9RtAiEMOsG5u vZi/He49mw4zJVBw== Authentication-Results: smtp-out1.suse.de; none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1790178786; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=5ZpHOllKr91B47qURGkTXZprS2C74/xpy/HfaqAeYw0=; b=H7y0iUr4SSp6LRQ7PfuiBjcozFk0z0Oq/CmycelFbq+Afj6suilCl4bkCrSenD2g5G2edv WsrNJRPqLRnsnBfiwOBuN6Fn/ENPj8hM8CkkYzklSh8g2U6DPI65gZKJtBu6rLuCcFDllO DVhYERZ9y8hIivrdYPTRRFG+TDIs4Xs= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1790178786; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=5ZpHOllKr91B47qURGkTXZprS2C74/xpy/HfaqAeYw0=; b=6M/qtodgbkVnOqFOhHA+9GWhbipOk4Ge0awE+PsKtcjvY2uVimNMhZqXffoeppRjpJyLyJ 9CAApWFaVkzY2GBw== Received: from imap1.dmz-prg2.suse.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by imap1.dmz-prg2.suse.org (Postfix) with ESMTPS id 92D9813432 for ; Wed, 23 Sep 2026 15:53:06 +0000 (UTC) Received: from dovecot-director2.suse.de ([2a07:de40:b281:106:10:150:64:167]) by imap1.dmz-prg2.suse.org with ESMTPSA id vIITF+L1s2qtRgAAD6G6ig (envelope-from ) for ; Wed, 23 Sep 2026 15:53:06 +0000 From: Tom de Vries To: gdb-patches@sourceware.org Subject: [pushed] [gdb/testsuite] Factor out unproc Date: Wed, 23 Sep 2026 17:53:06 +0200 Message-ID: <20260923155306.386212-1-tdevries@suse.de> X-Mailer: git-send-email 2.51.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spamd-Result: default: False [-2.80 / 50.00]; BAYES_HAM(-3.00)[100.00%]; MID_CONTAINS_FROM(1.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000]; R_MISSING_CHARSET(0.50)[]; NEURAL_HAM_SHORT(-0.20)[-0.996]; MIME_GOOD(-0.10)[text/plain]; ARC_NA(0.00)[]; RCPT_COUNT_ONE(0.00)[1]; RCVD_VIA_SMTP_AUTH(0.00)[]; MIME_TRACE(0.00)[0:+]; DKIM_SIGNED(0.00)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; PREVIOUSLY_DELIVERED(0.00)[gdb-patches@sourceware.org]; FROM_EQ_ENVFROM(0.00)[]; FROM_HAS_DN(0.00)[]; DBL_BLOCKED_OPENRESOLVER(0.00)[suse.de:mid,imap1.dmz-prg2.suse.org:helo]; RCVD_COUNT_TWO(0.00)[2]; TO_MATCH_ENVRCPT_ALL(0.00)[]; TO_DN_NONE(0.00)[]; RCVD_TLS_ALL(0.00)[] 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 I noticed in gdb.rocm/hcc-amdgpu-targets.exp: ... rename find_amdgpu_devices {} ... This deletes the proc find_amdgpu_devices. Unlike something like unset, it's not obvious what this does. Fix this by: - factoring out the rename into a new proc unproc, named using the set/unset pattern, and - adding a comment in unproc explaining what the effect of a rename to empty string is. Apply it using: ... $ find gdb/testsuite -type f -name *.exp* \ | xargs sed -i 's/rename \(.*\) {}/unproc \1/' ... and likewise for "". Tested on x86_64-linux. --- gdb/testsuite/gdb.guile/scm-parameter.exp | 2 +- gdb/testsuite/gdb.python/py-parameter.exp | 2 +- gdb/testsuite/gdb.rocm/hcc-amdgpu-targets.exp | 2 +- gdb/testsuite/lib/dwarf.exp | 4 ++-- gdb/testsuite/lib/future.exp | 16 ++++++++-------- gdb/testsuite/lib/gdb.exp | 10 ++++++++-- 6 files changed, 21 insertions(+), 15 deletions(-) diff --git a/gdb/testsuite/gdb.guile/scm-parameter.exp b/gdb/testsuite/gdb.guile/scm-parameter.exp index 123f45dbb49..c659ac2752b 100644 --- a/gdb/testsuite/gdb.guile/scm-parameter.exp +++ b/gdb/testsuite/gdb.guile/scm-parameter.exp @@ -562,7 +562,7 @@ with_test_prefix "set/show parameter" { gdb_test "show test-prefix-2" "^invoke -- show" } -rename scm_param_test_maybe_no_output "" +unproc scm_param_test_maybe_no_output # Test a color parameter. diff --git a/gdb/testsuite/gdb.python/py-parameter.exp b/gdb/testsuite/gdb.python/py-parameter.exp index b606b13b4ec..2a7a9b13fb6 100644 --- a/gdb/testsuite/gdb.python/py-parameter.exp +++ b/gdb/testsuite/gdb.python/py-parameter.exp @@ -912,4 +912,4 @@ test_ambiguous_parameter test_unknown_prefix test_set_show_parameters -rename py_param_test_maybe_no_output "" +unproc py_param_test_maybe_no_output diff --git a/gdb/testsuite/gdb.rocm/hcc-amdgpu-targets.exp b/gdb/testsuite/gdb.rocm/hcc-amdgpu-targets.exp index 8f04cca7981..690ecb8af32 100644 --- a/gdb/testsuite/gdb.rocm/hcc-amdgpu-targets.exp +++ b/gdb/testsuite/gdb.rocm/hcc-amdgpu-targets.exp @@ -28,7 +28,7 @@ proc with_stub_devices {devices body} { # tclint-disable-next-line command-args proc find_amdgpu_devices {} [list return $devices] set code [catch {uplevel 1 $body} result] - rename find_amdgpu_devices {} + unproc find_amdgpu_devices rename __saved_find_amdgpu_devices find_amdgpu_devices return -code $code $result } diff --git a/gdb/testsuite/lib/dwarf.exp b/gdb/testsuite/lib/dwarf.exp index 839c5174265..b37d63b868f 100644 --- a/gdb/testsuite/lib/dwarf.exp +++ b/gdb/testsuite/lib/dwarf.exp @@ -3060,8 +3060,8 @@ namespace eval Dwarf { variable _level uplevel $_level $body - rename include_dir "" - rename file_name "" + unproc include_dir + unproc file_name _line_finalize_header diff --git a/gdb/testsuite/lib/future.exp b/gdb/testsuite/lib/future.exp index fbe517f116b..44fc17b3f00 100644 --- a/gdb/testsuite/lib/future.exp +++ b/gdb/testsuite/lib/future.exp @@ -705,7 +705,7 @@ if {[info procs find_gnatmake] == ""} { set use_gdb_compile(ada) 1 gdb_note [join [list $note_prefix "Ada" $note_suffix] ""] } else { - rename gdb_find_gnatmake "" + unproc gdb_find_gnatmake } if {[info procs find_gfortran] == ""} { @@ -713,7 +713,7 @@ if {[info procs find_gfortran] == ""} { set use_gdb_compile(fortran) 1 gdb_note [join [list $note_prefix "Fortran" $note_suffix] ""] } else { - rename gdb_find_gfortran "" + unproc gdb_find_gfortran } if {[info procs find_go_linker] == ""} { @@ -722,8 +722,8 @@ if {[info procs find_go_linker] == ""} { set use_gdb_compile(go) 1 gdb_note [join [list $note_prefix "Go" $note_suffix] ""] } else { - rename gdb_find_go "" - rename gdb_find_go_linker "" + unproc gdb_find_go + unproc gdb_find_go_linker } if {[info procs find_gdc] == ""} { @@ -731,7 +731,7 @@ if {[info procs find_gdc] == ""} { set use_gdb_compile(d) 1 gdb_note [join [list $note_prefix "D" $note_suffix] ""] } else { - rename gdb_find_gdc "" + unproc gdb_find_gdc } if {[info procs find_rustc] == ""} { @@ -739,7 +739,7 @@ if {[info procs find_rustc] == ""} { set use_gdb_compile(rust) 1 gdb_note [join [list $note_prefix "Rust" $note_suffix] ""] } else { - rename gdb_find_rustc "" + unproc gdb_find_rustc } if {[info procs find_hip_compiler] == ""} { @@ -747,7 +747,7 @@ if {[info procs find_hip_compiler] == ""} { set use_gdb_compile(hip) 1 gdb_note [join [list $note_prefix "HIP" $note_suffix] ""] } else { - rename gdb_find_hip_compiler "" + unproc gdb_find_hip_compiler } # If dejagnu's default_target_compile is missing support for any language, @@ -756,7 +756,7 @@ if { [array size use_gdb_compile] != 0 } { catch {rename default_target_compile dejagnu_default_target_compile} rename gdb_default_target_compile default_target_compile } else { - rename gdb_default_target_compile "" + unproc gdb_default_target_compile } # Various ccache versions provide incorrect debug info such as ignoring diff --git a/gdb/testsuite/lib/gdb.exp b/gdb/testsuite/lib/gdb.exp index 1ebdaf6ba10..58753e721fd 100644 --- a/gdb/testsuite/lib/gdb.exp +++ b/gdb/testsuite/lib/gdb.exp @@ -8930,7 +8930,7 @@ proc gdb_finish { } { if { [info procs ::gdb_tcl_unknown] != "" } { # Restore dejagnu's version of proc unknown. - rename ::unknown "" + unproc ::unknown rename ::dejagnu_unknown ::unknown } @@ -11351,7 +11351,7 @@ proc with_override { name override body } { # tclint-disable-next-line command-args proc $name $old_args $old_body } else { - rename $name "" + unproc $name } # Return as appropriate. @@ -12466,6 +12466,12 @@ proc unprintable_to_octal { input_string } { # Ignore args and don't do anything. Can be used with proc with_override. proc nop {args} {} +# Delete proc P. +proc unproc {p} { + # Renaming to an empty string deletes proc P. + uplevel 1 [list rename $p {}] +} + require {tcl_version_at_least 8 6 2} # Always load compatibility stuff. base-commit: 441953ac9d0b2902be92906817c68feadccd190f -- 2.51.0