From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id nQfnDz5wyl/UOwAAWB0awg (envelope-from ) for ; Fri, 04 Dec 2020 12:22:06 -0500 Received: by simark.ca (Postfix, from userid 112) id 3328F1F0AB; Fri, 4 Dec 2020 12:22:06 -0500 (EST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-1.0 required=5.0 tests=MAILING_LIST_MULTI, URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 Received: from 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 RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id A02E21E58D for ; Fri, 4 Dec 2020 12:22:04 -0500 (EST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 376E6386F81C; Fri, 4 Dec 2020 17:22:04 +0000 (GMT) Received: from simark.ca (simark.ca [158.69.221.121]) by sourceware.org (Postfix) with ESMTPS id 3C9843858001 for ; Fri, 4 Dec 2020 17:22:01 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 3C9843858001 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=simark.ca Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=simark@simark.ca Received: from [172.16.0.95] (192-222-181-218.qc.cable.ebox.net [192.222.181.218]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPSA id DD9D71E58D; Fri, 4 Dec 2020 12:22:00 -0500 (EST) Subject: Re: [PING][PATCH v2] Fix multi-line strings in TuiWindow.write To: Hannes Domani , "gdb-patches@sourceware.org" References: <1529224928.468621.1607091529134.ref@mail.yahoo.com> <1529224928.468621.1607091529134@mail.yahoo.com> From: Simon Marchi Message-ID: Date: Fri, 4 Dec 2020 12:22:00 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 MIME-Version: 1.0 In-Reply-To: <1529224928.468621.1607091529134@mail.yahoo.com> Content-Type: text/plain; charset=utf-8 Content-Language: tl Content-Transfer-Encoding: 7bit X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gdb-patches-bounces@sourceware.org Sender: "Gdb-patches" On 2020-12-04 9:18 a.m., Hannes Domani via Gdb-patches wrote: > Ping. > > Am Freitag, 20. November 2020, 01:01:43 MEZ hat Hannes Domani via Gdb-patches Folgendes geschrieben: > >> Currently multi-line strings are all written to the first line. >> >> Since tui_copy_source_line sets the text variable to the start of the >> next line, the check for newline has to be done with the previous character. >> >> gdb/ChangeLog: >> >> 2020-11-19 Hannes Domani >> >> * python/py-tui.c (tui_py_window::output): Fix multi-line strings. >> --- >> v2: >> - Don't break multiple TuiWindow.write calls without newline characters. >> --- >> gdb/python/py-tui.c | 4 ++-- >> 1 file changed, 2 insertions(+), 2 deletions(-) >> >> diff --git a/gdb/python/py-tui.c b/gdb/python/py-tui.c >> index 95c71f1d2d..306bd7b801 100644 >> --- a/gdb/python/py-tui.c >> +++ b/gdb/python/py-tui.c >> @@ -203,13 +203,13 @@ tui_py_window::output (const char *text) >> { >> wmove (handle.get (), cursor_y + 1, cursor_x + 1); >> >> + const char *prev_text = text; >> std::string line = tui_copy_source_line (&text, 0, 0, >> vwidth - cursor_x, 0); >> tui_puts (line.c_str (), handle.get ()); >> >> - if (*text == '\n') >> + if (text > prev_text && (text[-1] == '\n' || text[-1] == '\r')) >> { >> - ++text; >> ++cursor_y; >> cursor_x = 0; >> } >> -- >> 2.29.2 I tried to apply this and give it a try (although I know nothing about this code), and it looks like the patch is based on an old commit. This code was changed in September, quite a bit before your original patch: https://sourceware.org/git/?p=binutils-gdb.git;a=commitdiff;h=149830c137f351cb41888f87493cc42a72dbeac7;hp=5f278258ccae6a666c72de709a3171975fbaeb05 Can you see if the issue still exists in current master? And if so, the fix will have to be adapted to the new code. Simon