From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id mol7K9JGemjddBcAWB0awg (envelope-from ) for ; Fri, 18 Jul 2025 09:06:26 -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=t69W2/Jt; dkim=pass header.d=suse.de header.i=@suse.de header.a=ed25519-sha256 header.s=susede2_ed25519 header.b=9wphml57; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.a=rsa-sha256 header.s=susede2_rsa header.b=t69W2/Jt; dkim=neutral header.d=suse.de header.i=@suse.de header.a=ed25519-sha256 header.s=susede2_ed25519 header.b=9wphml57; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id 9D55A1E11C; Fri, 18 Jul 2025 09:06:26 -0400 (EDT) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-25) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-9.1 required=5.0 tests=ARC_SIGNED,ARC_VALID,BAYES_00, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED,RCVD_IN_VALIDITY_CERTIFIED,RCVD_IN_VALIDITY_RPBL, RCVD_IN_VALIDITY_SAFE autolearn=ham autolearn_force=no version=4.0.1 Received: from server2.sourceware.org (server2.sourceware.org [8.43.85.97]) (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 1A3F01E089 for ; Fri, 18 Jul 2025 09:06:26 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id C0A1E3852764 for ; Fri, 18 Jul 2025 13:06:25 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org C0A1E3852764 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=t69W2/Jt; dkim=pass header.d=suse.de header.i=@suse.de header.a=ed25519-sha256 header.s=susede2_ed25519 header.b=9wphml57; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.a=rsa-sha256 header.s=susede2_rsa header.b=t69W2/Jt; dkim=neutral header.d=suse.de header.i=@suse.de header.a=ed25519-sha256 header.s=susede2_ed25519 header.b=9wphml57 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 0254B3851A92 for ; Fri, 18 Jul 2025 13:02:14 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 0254B3851A92 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 0254B3851A92 Authentication-Results: server2.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=1752843734; cv=none; b=wQ74PUxpTTa5RFsHLrxBR7LJ0WL9UhfwQJkaIxmBBHMtTaiHJo8JzmjFkvQIIrG4bGHnceLyksVLjNwCkVzz6GDx+oREGNS4fKzjlUqgfH9g5IUD25AoX+PczUZ2Un0lwr4iVqsENM4ZeHnFkoXdY2rcCQnUtdirIInlKmAfwfw= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1752843734; c=relaxed/simple; bh=8E1tAJ9TcI5ZL+09BxmHTeoR6hw2V1PxhI3vHXEo4Go=; h=DKIM-Signature:DKIM-Signature:DKIM-Signature:DKIM-Signature:From: To:Subject:Date:Message-ID:MIME-Version; b=BN0UuihHx+MPZYh7IxdXAvD7966ZKeNl7GGoyn9hX/SvATqv7CaQr2N/f51yUnpkJvaQ2lBxJU7QnGGMVW/+viABaP24m9WIs9ut5iiUDjkq69EW6lCMp9ugUHu3IpfNdGueEgeayFURZeFDB3PTS3IzEiCgZx1X+e6zUMpUtec= ARC-Authentication-Results: i=1; server2.sourceware.org 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 4921B21170 for ; Fri, 18 Jul 2025 13:01:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1752843716; 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=HDU3GoJh5QJAGiayD6VHFFxE27rLG2awiGUIS4ciGAE=; b=t69W2/Jtutm+WFGtAJUiaO8m+vHGgr9ojxBW3RcnRjxHTGChN9WbOX8Fe19aX0D5WT+G7z EcgtVtyxrVE2brpcCefm6TbI9efkQsf61RNeaIKJDXk7GEu5evFlparDQ5aIGmeioD3V6M Pm3uGyG9CCOEQarHj/u6vowlikEtu/I= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1752843716; 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=HDU3GoJh5QJAGiayD6VHFFxE27rLG2awiGUIS4ciGAE=; b=9wphml57DL1Zs8DawKfF4qlwZCEqe8zTp8qYYY13C0Cplt039JOLmHwtjwTgSRybXJS8zj unm1VXraTdqWd2BQ== Authentication-Results: smtp-out1.suse.de; none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1752843716; 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=HDU3GoJh5QJAGiayD6VHFFxE27rLG2awiGUIS4ciGAE=; b=t69W2/Jtutm+WFGtAJUiaO8m+vHGgr9ojxBW3RcnRjxHTGChN9WbOX8Fe19aX0D5WT+G7z EcgtVtyxrVE2brpcCefm6TbI9efkQsf61RNeaIKJDXk7GEu5evFlparDQ5aIGmeioD3V6M Pm3uGyG9CCOEQarHj/u6vowlikEtu/I= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1752843716; 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=HDU3GoJh5QJAGiayD6VHFFxE27rLG2awiGUIS4ciGAE=; b=9wphml57DL1Zs8DawKfF4qlwZCEqe8zTp8qYYY13C0Cplt039JOLmHwtjwTgSRybXJS8zj unm1VXraTdqWd2BQ== 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 0BE8F13ABE for ; Fri, 18 Jul 2025 13:01:56 +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 iCBgAcRFemjOHAAAD6G6ig (envelope-from ) for ; Fri, 18 Jul 2025 13:01:56 +0000 From: Tom de Vries To: gdb-patches@sourceware.org Subject: [PATCH 6/7] [gdb/testsuite] Use TERM=ansiw in tuiterm for bsd Date: Fri, 18 Jul 2025 15:01:52 +0200 Message-ID: <20250718130153.24989-7-tdevries@suse.de> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250718130153.24989-1-tdevries@suse.de> References: <20250718130153.24989-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)[99.99%]; NEURAL_HAM_LONG(-1.00)[-1.000]; MID_CONTAINS_FROM(1.00)[]; R_MISSING_CHARSET(0.50)[]; NEURAL_HAM_SHORT(-0.20)[-1.000]; MIME_GOOD(-0.10)[text/plain]; FUZZY_RATELIMITED(0.00)[rspamd.com]; RCVD_VIA_SMTP_AUTH(0.00)[]; RCPT_COUNT_ONE(0.00)[1]; ARC_NA(0.00)[]; DKIM_SIGNED(0.00)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; DBL_BLOCKED_OPENRESOLVER(0.00)[suse.de:mid,gdb.tui:url]; 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)[]; PREVIOUSLY_DELIVERED(0.00)[gdb-patches@sourceware.org]; 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 TERM=ansi is different on freebsd and linux. Consequently, many TUI test-cases (gdb.tui/*.exp and gdb.python/tui*.exp) fail on freebsd. One of the problems is that send_gdb "\r\n" is needed instead of send_gdb "\n". This is because gdb_send "layout regs\n" translates to "layout regs", which evidently missing the carriage return part. While we can work around this, there are other problems. There is no color support, and the cursor keys fail to scroll the source window. So I went looking for an alternative to TERM=ansi on freebsd, and came across TERM=ansiw. Using this didn't work out of the box, but with the fixes in this series it now does. I also briefly looked at TERM=ansis, which is interesting because it's available on both linux and freebsd, but ansiw is a better choice for now. I've filed PR33179 to document what I learned, with the aim to eventually follow up and address two test-case failures with TERM=ansis on linux. Tested on x86_64-freebsd. --- gdb/testsuite/lib/tuiterm.exp | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/gdb/testsuite/lib/tuiterm.exp b/gdb/testsuite/lib/tuiterm.exp index 10c5a3d0dce..76351841988 100644 --- a/gdb/testsuite/lib/tuiterm.exp +++ b/gdb/testsuite/lib/tuiterm.exp @@ -92,6 +92,9 @@ namespace eval Term { # Return 1 if tuiterm has the bw/auto_left_margin enabled. proc _have_bw {} { + if { [string equal $Term::_TERM "ansiw"] } { + return 1 + } return 0 } @@ -890,8 +893,16 @@ namespace eval Term { # BODY. proc with_tuiterm {rows cols body} { global env stty_init + variable _TERM save_vars {env(TERM) env(NO_COLOR) stty_init} { - setenv TERM ansi + if { [ishost *-*-*bsd*] } { + setenv TERM ansiw + } else { + setenv TERM ansi + } + # Save active TERM variable. + set Term::_TERM $env(TERM) + setenv NO_COLOR "" _setup $rows $cols -- 2.43.0