From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp-out1.suse.de (smtp-out1.suse.de [IPv6:2001:67c:2178:6::1c]) by sourceware.org (Postfix) with ESMTPS id 3899C3858C5E for ; Tue, 11 Apr 2023 08:23:25 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 3899C3858C5E Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=suse.de Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=suse.de Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id 537C121A59; Tue, 11 Apr 2023 08:23:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1681201404; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Vpzqpk8sUiJFCxfIAwQ7wBxg8N55fV6GalnqXK2juSQ=; b=vnCJpHMFwtZT0n73t4+jEz6ZiJldmHQMGYhFhHs7VyKQuL7jfkVff2OmYLWdowZwjh0toO 4LPWfC4TOOuPxTcMYkgIMUBe3ILjy4XlCQGnP5wJNsXMB4tsRvWhEhn03BriThMouDa1Hv Mq1mZw04c00OfGyi0iDe/P6Bd+I4mKY= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1681201404; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Vpzqpk8sUiJFCxfIAwQ7wBxg8N55fV6GalnqXK2juSQ=; b=DPrNfWd8pDTuusbiSLeZP023FMeH+9D3n0GswMVB7jbPQNI46QShpu1zqiJDba3xY4k71u B23aX6PtYS1fH8Dg== Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 39D9013638; Tue, 11 Apr 2023 08:23:24 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id YHQZDfwYNWRpBAAAMHmgww (envelope-from ); Tue, 11 Apr 2023 08:23:24 +0000 From: Tom de Vries To: gdb-patches@sourceware.org Cc: Tom Tromey Subject: [PATCH 3/3] [gdb/tui] Revert workaround in tui_source_window::show_line_number Date: Tue, 11 Apr 2023 10:23:32 +0200 Message-Id: <20230411082332.25052-3-tdevries@suse.de> X-Mailer: git-send-email 2.35.3 In-Reply-To: <20230411082332.25052-1-tdevries@suse.de> References: <20230411082332.25052-1-tdevries@suse.de> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-12.4 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,GIT_PATCH_0,SPF_HELO_NONE,SPF_PASS,TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: The m_digits member of tui_source_window is documented as having semantics: ... /* How many digits to use when formatting the line number. This includes the trailing space. */ ... The commit 1b6d4bb2232 ("Redraw both spaces between line numbers and source code") started printing two trailing spaces instead: ... - xsnprintf (text, sizeof (text), "%*d ", m_digits - 1, lineno); + xsnprintf (text, sizeof (text), "%*d ", m_digits - 1, lineno); ... Now that PR30325 is fixed, this no longer has any effect. Fix this by reverting to the original behaviour: print one trailing space char. Tested on x86_64-linux. --- gdb/tui/tui-source.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/gdb/tui/tui-source.c b/gdb/tui/tui-source.c index aa3e58407c4..3d08ea8b7cd 100644 --- a/gdb/tui/tui-source.c +++ b/gdb/tui/tui-source.c @@ -232,11 +232,9 @@ tui_source_window::show_line_number (int offset) const { int lineno = m_content[0].line_or_addr.u.line_no + offset; char text[20]; - /* To completely overwrite the previous border when the source window height - is increased, both spaces after the line number have to be redrawn. */ char space = tui_left_margin_verbose ? '_' : ' '; xsnprintf (text, sizeof (text), - tui_left_margin_verbose ? "%0*d%c%c" : "%*d%c%c", m_digits - 1, - lineno, space, space); + tui_left_margin_verbose ? "%0*d%c" : "%*d%c", m_digits - 1, + lineno, space); waddstr (handle.get (), text); } -- 2.35.3