Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Simon Marchi <simark@simark.ca>
To: Hannes Domani <ssbssa@yahoo.de>,
	"gdb-patches@sourceware.org" <gdb-patches@sourceware.org>
Subject: Re: [PING][PATCH v2] Fix multi-line strings in TuiWindow.write
Date: Fri, 4 Dec 2020 12:22:00 -0500	[thread overview]
Message-ID: <f2384b2b-13d5-0093-74ab-864eb17c597b@simark.ca> (raw)
In-Reply-To: <1529224928.468621.1607091529134@mail.yahoo.com>


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 <gdb-patches@sourceware.org> 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  <ssbssa@yahoo.de>
>>
>>      * 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

  reply	other threads:[~2020-12-04 17:22 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <1529224928.468621.1607091529134.ref@mail.yahoo.com>
2020-12-04 14:18 ` Hannes Domani via Gdb-patches
2020-12-04 17:22   ` Simon Marchi [this message]
2020-12-04 18:23     ` Hannes Domani via Gdb-patches

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=f2384b2b-13d5-0093-74ab-864eb17c597b@simark.ca \
    --to=simark@simark.ca \
    --cc=gdb-patches@sourceware.org \
    --cc=ssbssa@yahoo.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox