From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id UZwZMfKYz2r8ZAkAWB0awg (envelope-from ) for ; Wed, 14 Oct 2026 11:00:02 -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=Jvo4FKdd; dkim=pass header.d=suse.de header.i=@suse.de header.a=ed25519-sha256 header.s=susede2_ed25519 header.b=CrFAfH5R; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.a=rsa-sha256 header.s=susede2_rsa header.b=Jvo4FKdd; dkim=neutral header.d=suse.de header.i=@suse.de header.a=ed25519-sha256 header.s=susede2_ed25519 header.b=CrFAfH5R; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id BC6981E050; Wed, 14 Oct 2026 11:00:02 -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 B022A1E04E for ; Wed, 14 Oct 2026 11:00:00 -0400 (EDT) Received: from vm01.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 947F54BA2E1F for ; Wed, 14 Oct 2026 14:59:59 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 947F54BA2E1F 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=Jvo4FKdd; dkim=pass header.d=suse.de header.i=@suse.de header.a=ed25519-sha256 header.s=susede2_ed25519 header.b=CrFAfH5R; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.a=rsa-sha256 header.s=susede2_rsa header.b=Jvo4FKdd; dkim=neutral header.d=suse.de header.i=@suse.de header.a=ed25519-sha256 header.s=susede2_ed25519 header.b=CrFAfH5R 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 8EC7A4BA2E25 for ; Wed, 14 Oct 2026 14:58:40 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 8EC7A4BA2E25 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 8EC7A4BA2E25 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=1791989920; cv=none; b=WdVR1XTauxYtlTmfDjXZIDPWvIm4dXvhLQTvTerWj/zdiIRZu3EJ1V+bcbEmk8toL7PoVjStBxrXzwL04eHT3F4wirbhb+Swz6ylZk+H9AZ0/B8cXSFA/bu9d2dyCubZXNyPVdlZ4JpC7xQ/HTfm7Ach9v7IPx/hykzA3fF1ESU= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1791989920; c=relaxed/simple; bh=MSH1Yx3JI3aO8lzWLKeGb1GexLZ+iVqJ7ljQk/R7Tno=; h=DKIM-Signature:DKIM-Signature:DKIM-Signature:DKIM-Signature:From: To:Subject:Date:Message-ID:MIME-Version; b=JO94uAh46hXMf2RjopKBX6FhMxNl7eIbK02J6Zc359nOREkRepA9TF1YqeTxRPinRTpwkhSfcLAJRkoiKNl2laq5ZD6OKUQIHaLc1FxqfI8f2L3OfinI/hMEXgYDP09Jx+Ifrtl+PWKV3kEpNFLYdUUud9Q+9iMuBicSrpMiGlA= 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=Jvo4FKdd; dkim=pass header.d=suse.de header.i=@suse.de header.a=ed25519-sha256 header.s=susede2_ed25519 header.b=CrFAfH5R; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.a=rsa-sha256 header.s=susede2_rsa header.b=Jvo4FKdd; dkim=neutral header.d=suse.de header.i=@suse.de header.a=ed25519-sha256 header.s=susede2_ed25519 header.b=CrFAfH5R DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 8EC7A4BA2E25 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 94E262224E for ; Wed, 14 Oct 2026 14:58:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1791989919; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=rEWYENyKnJ8DJi7Jqz0c3f9CP/lQOR6a+NI/9Z5PsYo=; b=Jvo4FKddHvmUl6yunMPqX9D/EHiSFxxJkSiKECvJaRH/XP4haQt/MSImeIlPGQXI1kdfCG EkX7FT3250qxAsqi62UO4s04t4dcqvKNnd6fAbki/mDN6H4X5YkqW6qIABFjZQmKiQJ2QH XbtF3jzDrXWy12F1DgqcG73sg8+xK4o= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1791989919; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=rEWYENyKnJ8DJi7Jqz0c3f9CP/lQOR6a+NI/9Z5PsYo=; b=CrFAfH5Rf/nkYzj04RJonT/PiD2aJJ0dLb4Rt/0V0cHtR9Cc5lgE/iH1in6Xp7CObpGCJ7 GRLEO5UMauiu5lAQ== Authentication-Results: smtp-out1.suse.de; none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1791989919; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=rEWYENyKnJ8DJi7Jqz0c3f9CP/lQOR6a+NI/9Z5PsYo=; b=Jvo4FKddHvmUl6yunMPqX9D/EHiSFxxJkSiKECvJaRH/XP4haQt/MSImeIlPGQXI1kdfCG EkX7FT3250qxAsqi62UO4s04t4dcqvKNnd6fAbki/mDN6H4X5YkqW6qIABFjZQmKiQJ2QH XbtF3jzDrXWy12F1DgqcG73sg8+xK4o= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1791989919; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=rEWYENyKnJ8DJi7Jqz0c3f9CP/lQOR6a+NI/9Z5PsYo=; b=CrFAfH5Rf/nkYzj04RJonT/PiD2aJJ0dLb4Rt/0V0cHtR9Cc5lgE/iH1in6Xp7CObpGCJ7 GRLEO5UMauiu5lAQ== 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 3EAAE13751 for ; Wed, 14 Oct 2026 14:58:39 +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 92gBHp6Yz2qpIgAAD6G6ig:T6 (envelope-from ) for ; Wed, 14 Oct 2026 14:58:39 +0000 From: Tom de Vries To: gdb-patches@sourceware.org Subject: [pushed 5/7] [gdb/testsuite] Work around namespace problem in tclint plugin Date: Wed, 14 Oct 2026 16:58:36 +0200 Message-ID: <20261014145838.3560108-6-tdevries@suse.de> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20261014145838.3560108-1-tdevries@suse.de> References: <20261014145838.3560108-1-tdevries@suse.de> 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)[-1.000]; MIME_GOOD(-0.10)[text/plain]; RCPT_COUNT_ONE(0.00)[1]; RCVD_VIA_SMTP_AUTH(0.00)[]; ARC_NA(0.00)[]; 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)[]; MIME_TRACE(0.00)[0:+]; 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 that tclint checks don't work in Term::_log_cur uses in tuiterm procs. The problem is that while calls using Term::_log_cur are checked, the ones using plain _log_cur aren't. I've filed a tclint issue about this [1]. Work around this in the tclint plugin, and fix the fallout in lib/tuiterm.exp. [1] https://github.com/nmoroze/tclint/issues/174 --- gdb/testsuite/lib/tuiterm.exp | 30 +++++++++++++++--------------- gdb/testsuite/tclint-plugin.py | 6 ++++++ 2 files changed, 21 insertions(+), 15 deletions(-) diff --git a/gdb/testsuite/lib/tuiterm.exp b/gdb/testsuite/lib/tuiterm.exp index 71682785eea..6140d32872f 100644 --- a/gdb/testsuite/lib/tuiterm.exp +++ b/gdb/testsuite/lib/tuiterm.exp @@ -133,7 +133,7 @@ proc Term::_ctl_0x08 { {bw -1} } { } # Wrap to previous line. - set _cur_col [expr $_cols - 1] + set _cur_col [expr {$_cols - 1}] incr _cur_row -1 } } @@ -162,8 +162,8 @@ proc Term::_ctl_0x0a {} { # cursor back on the screen. But we wrap the # scrolling inside a while loop just to be on the safe # side. - for {set y 0} {$y < [expr $_rows - 1]} {incr y} { - set next_y [expr $y + 1] + for {set y 0} {$y < $_rows - 1} {incr y} { + set next_y [expr {$y + 1}] _copy_line $next_y $y } @@ -226,13 +226,13 @@ proc Term::_csi_@ {args} { # Move characters right of the cursor right by N positions, # starting with the rightmost one. - for {set in_col [expr $_cols - $n - 1]} {$in_col >= $_cur_col} {incr in_col -1} { - set out_col [expr $in_col + $n] + for {set in_col [expr {$_cols - $n - 1}]} {$in_col >= $_cur_col} {incr in_col -1} { + set out_col [expr {$in_col + $n}] set _chars($out_col,$_cur_row) $_chars($in_col,$_cur_row) } # Write N blank spaces starting from the cursor. - _clear_in_line $_cur_col [expr $_cur_col + $n] $_cur_row + _clear_in_line $_cur_col [expr {$_cur_col + $n}] $_cur_row } } @@ -339,7 +339,7 @@ proc Term::_csi_G {args} { variable _cur_col variable _cols - set _cur_col [expr {min ($arg, $_cols)} - 1] + set _cur_col [expr {min ($arg, $_cols) - 1}] } } @@ -402,7 +402,7 @@ proc Term::_csi_J {args} { } elseif {$arg == 1} { # Beginning of display to cursor (inclusive). _clear_lines 0 $_cur_row - _clear_in_line 0 [expr $_cur_col + 1] $_cur_row + _clear_in_line 0 [expr {$_cur_col + 1}] $_cur_row } elseif {$arg == 2} { # Entire display. _clear_lines 0 $_rows @@ -426,7 +426,7 @@ proc Term::_csi_K {args} { _clear_in_line $_cur_col $_cols $_cur_row } elseif {$arg == 1} { # Beginning of line to cursor (inclusive). - _clear_in_line 0 [expr $_cur_col + 1] $_cur_row + _clear_in_line 0 [expr {$_cur_col + 1}] $_cur_row } elseif {$arg == 2} { # Entire line. _clear_in_line 0 $_cols $_cur_row @@ -493,7 +493,7 @@ proc Term::_csi_L {args} { incr next_y -1 } - _clear_lines $_cur_row [expr $_cur_row + $arg] + _clear_lines $_cur_row [expr {$_cur_row + $arg}] } } @@ -531,8 +531,8 @@ proc Term::_csi_P {args} { variable _cols # Move all characters right of the cursor N positions left. - set out_col [expr $_cur_col] - set in_col [expr $_cur_col + $count] + set out_col $_cur_col + set in_col [expr {$_cur_col + $count}] while {$in_col < $_cols} { set _chars($out_col,$_cur_row) $_chars($in_col,$_cur_row) @@ -664,7 +664,7 @@ proc Term::_csi_d {args} { variable _cur_row variable _rows - set _cur_row [expr min ($row - 1, $_rows - 1)] + set _cur_row [expr {min ($row - 1, $_rows - 1)}] } } @@ -886,13 +886,13 @@ proc Term::_csi_m {args} { set _attrs(invisible) 0 } 30 - 31 - 32 - 33 - 34 - 35 - 36 - 37 { - set _attrs(fg) [_color_attr [expr $item - 30]] + set _attrs(fg) [_color_attr [expr {$item - 30}]] } 39 { set _attrs(fg) default } 40 - 41 - 42 - 43 - 44 - 45 - 46 - 47 { - set _attrs(bg) [_color_attr [expr $item - 40]] + set _attrs(bg) [_color_attr [expr {$item - 40}]] } 49 { set _attrs(bg) default diff --git a/gdb/testsuite/tclint-plugin.py b/gdb/testsuite/tclint-plugin.py index 5a09397c3a7..afe959dea3a 100644 --- a/gdb/testsuite/tclint-plugin.py +++ b/gdb/testsuite/tclint-plugin.py @@ -207,8 +207,14 @@ commands = commands_schema( "with_ansi_styling_terminal": _with_ansi_styling_terminal, "with_lock": _with_lock, "with_rocm_gpu_lock": _with_rocm_gpu_lock, + # Calls without explicit namespace prefix are not caught, so for now + # we add both. This may clash with procs outside the namespace. + # https://github.com/nmoroze/tclint/issues/174 "Term::_log_cur": _ns_term_log_cur, + "_log_cur": _ns_term_log_cur, "Term::with_term": _ns_term_with_term, + "with_term": _ns_term_with_term, "Term::with_tuiterm": _ns_term_with_tuiterm, + "with_tuiterm": _ns_term_with_tuiterm, } ) -- 2.51.0