public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Tom Tromey <tom@tromey.com>
To: Pedro Alves <palves@redhat.com>
Cc: Tom Tromey <tom@tromey.com>,  gdb-patches@sourceware.org
Subject: Re: [PATCH 05/14] Change tui_data_item_window::content to be a unique_xmalloc_ptr
Date: Tue, 20 Aug 2019 22:34:00 -0000	[thread overview]
Message-ID: <87ef1fii1d.fsf@tromey.com> (raw)
In-Reply-To: <9ba121e8-8767-3b75-6cee-9496430fe908@redhat.com> (Pedro Alves's	message of "Tue, 20 Aug 2019 16:19:17 +0100")

>>>>> "Pedro" == Pedro Alves <palves@redhat.com> writes:

Pedro> On 8/18/19 6:27 PM, Tom Tromey wrote:
>> @@ -309,19 +301,13 @@ tui_data_window::display_registers_from (int start_element_no)
>> int max_len = 0;
>> for (auto &&data_item_win : regs_content)
>> {
>> -          char *p;
>> +          const char *p;
>> int len;
>> 
>> len = 0;
>> -          p = data_item_win->content;
>> +          p = data_item_win->content.get ();
>> if (p != 0)
>> -            while (*p)
>> -              {
>> -                if (*p++ == '\t')
>> -                  len = 8 * ((len / 8) + 1);
>> -                else
>> -                  len++;
>> -              }
>> +	    len = strlen (p);
>> 

Pedro> Is this related?  

Yeah, though it isn't obvious.  I will amend the commit message to make
this clear.

What is happening here is that the content can only be computed by
tui_register_format, which calls tui_expand_tabs before returning.  So,
it's not possible to see a tab in the contents.

Pedro> (Also, I didn't bother to think through whether strlen
Pedro> is equivalent to the old code.  Is it?)

I think so.

Tom

  reply	other threads:[~2019-08-20 22:34 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-08-18 17:27 [PATCH 00/14] TUI refactoring round N Tom Tromey
2019-08-18 17:27 ` [PATCH 05/14] Change tui_data_item_window::content to be a unique_xmalloc_ptr Tom Tromey
2019-08-20 15:19   ` Pedro Alves
2019-08-20 22:34     ` Tom Tromey [this message]
2019-08-18 17:27 ` [PATCH 06/14] Rearrange tui-regs.c some more Tom Tromey
2019-08-18 17:27 ` [PATCH 02/14] Remove NULL check from tui_reg_command Tom Tromey
2019-08-18 17:27 ` [PATCH 07/14] Change tui_check_register_values to be a method Tom Tromey
2019-08-18 17:27 ` [PATCH 12/14] Move some defines to tui-stack.c Tom Tromey
2019-08-18 17:27 ` [PATCH 10/14] Remove tui_data_window::display_regs Tom Tromey
2019-08-18 17:27 ` [PATCH 09/14] Remove indirection from tui_data_window::regs_content Tom Tromey
2019-08-18 17:27 ` [PATCH 04/14] Remove tui_data_item_window::value Tom Tromey
2019-08-18 17:27 ` [PATCH 11/14] Change tui_make_window to be a method Tom Tromey
2019-08-18 17:27 ` [PATCH 13/14] Remove some defines from tui-data.h Tom Tromey
2019-08-18 17:27 ` [PATCH 01/14] Some i18n fixes for the TUI Tom Tromey
2019-08-18 17:27 ` [PATCH 03/14] Minor rearrangement in tui-regs.c Tom Tromey
2019-08-18 17:27 ` [PATCH 08/14] Add two methods to tui_data_window Tom Tromey
2019-08-18 17:27 ` [PATCH 14/14] Change some tui_data_window methods to be private Tom Tromey
2019-08-20 15:19 ` [PATCH 00/14] TUI refactoring round N Pedro Alves

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=87ef1fii1d.fsf@tromey.com \
    --to=tom@tromey.com \
    --cc=gdb-patches@sourceware.org \
    --cc=palves@redhat.com \
    /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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).