public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Simon Marchi <simon.marchi@polymtl.ca>
To: Pedro Alves <pedro@palves.net>, gdb-patches@sourceware.org
Cc: Simon Marchi <simon.marchi@efficios.com>
Subject: Re: [PATCH 02/11] gdb: introduce intrusive_list, make thread_info use it
Date: Wed, 7 Jul 2021 09:52:52 -0400	[thread overview]
Message-ID: <de1026cf-5a1a-2024-53b0-07a307a35fbd@polymtl.ca> (raw)
In-Reply-To: <00b850dc-6d17-1651-e8d2-4712d03950b8@palves.net>

On 2021-07-07 7:46 a.m., Pedro Alves wrote:
>> I think these are all good ideas for improvements, but I'd rather keep
>> them for later (if someone wants to implement them, I'm not sure I
>> will).  We could bike-shed for a while on how to display a thread_info,
>> what to include / what to exclude, etc.  I think that my original
>> proposal is strictly better than what we have today, in the sense that
>> today you just can't print the whole list of threads, so we don't lose
>> anything.
> 
> The discussion about the thread_info pretty printer, yes, agreed.
> 
> However, the discussion on the list printer itself, one point that we should
> settle discuss a bit more is whether it is really the right approach to make it
> show children as pointers.  
> 
> Showing pointers really looks not useful to me.  The only thing I think I get
> out of it is that there are elements in the list.
> 
> I mean, AFAICT, even the std::list printer shows objects, not pointers,
> for instance:
> 
>  (gdb) p my_list
>  $1 = std::__cxx11::list = {[0] = 1, [1] = 2, [2] = 3}
> 
> Hmm, funny, it shows the indexes, even though I don't have
> array-indexes off.  Guess it must be using "map", but I haven't checked.

In fact, it doesn't specify any display_hint.  The [%d] comes from here:

   https://gitlab.com/gnutools/gcc/-/blob/trunk/libstdc%2B%2B-v3/python/libstdcxx/v6/printers.py#L313

So it's as if the children of the list are members of a structure, with
names [0], [1], and so on.  That doesn't look totally right to me but...
I'll pretend I didn't see it.

> Imagine we were using std::list for thread_info objects.
> 
> But I don't think that that discussion should block the main change
> from going in.  I'd support moving the printer out to a separate patch,
> even.

Well, the printer mostly works, so I think it's ok to include it.  I
agree with you that printing pointers is not ideal.  For objects smaller
than thread_info, it would certainly be useful to see the objects and
not pointers.  So I will make the quick change to make the list children
be objects and pointers.  Sure, printing the thread list will be very
verbose, but the same argument I made earlier applies: it's not a
regression, since printing the whole list is simply not possible today.

Simon

  reply	other threads:[~2021-07-07 13:53 UTC|newest]

Thread overview: 49+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-22 16:56 [PATCH 00/11] Various thread lists optimizations Simon Marchi
2021-06-22 16:56 ` [PATCH 01/11] gdb: introduce iterator_range, remove next_adapter Simon Marchi
2021-07-05 15:41   ` Pedro Alves
2021-07-06 19:16     ` Simon Marchi
2021-06-22 16:56 ` [PATCH 02/11] gdb: introduce intrusive_list, make thread_info use it Simon Marchi
2021-06-22 23:13   ` Lancelot SIX
2021-06-23  0:48     ` Simon Marchi
2021-07-05 15:44   ` Pedro Alves
2021-07-06 19:38     ` Simon Marchi
2021-07-06 20:45       ` Simon Marchi
2021-07-06 21:04         ` Pedro Alves
2021-07-06 21:38           ` Simon Marchi
2021-07-06 21:02       ` Pedro Alves
2021-07-06 21:45         ` Simon Marchi
2021-07-07 11:46           ` Pedro Alves
2021-07-07 13:52             ` Simon Marchi [this message]
2021-06-22 16:56 ` [PATCH 03/11] gdb: make inferior_list use intrusive_list Simon Marchi
2021-07-05 15:44   ` Pedro Alves
2021-07-14  6:34     ` Tom de Vries
2021-07-14 16:11       ` Simon Marchi
2021-07-14 20:15         ` [PATCH] gdb: make all_inferiors_safe actually work Simon Marchi
2021-07-15 10:15           ` Tom de Vries
2021-07-17 12:54             ` Simon Marchi
2021-06-22 16:56 ` [PATCH 04/11] gdb: use intrusive list for step-over chain Simon Marchi
2021-07-05 15:45   ` Pedro Alves
2021-07-06 20:59     ` Simon Marchi
2021-06-22 16:56 ` [PATCH 05/11] gdb: add setter / getter for thread_info resumed state Simon Marchi
2021-07-05 15:45   ` Pedro Alves
2021-06-22 16:56 ` [PATCH 06/11] gdb: make thread_info::suspend private, add getters / setters Simon Marchi
2021-07-05 15:45   ` Pedro Alves
2021-06-22 16:57 ` [PATCH 07/11] gdb: maintain per-process-target list of resumed threads with pending wait status Simon Marchi
2021-07-05 15:51   ` Pedro Alves
2021-07-06 21:25     ` Simon Marchi
2021-07-07 12:01       ` Pedro Alves
2021-07-12 22:28         ` Simon Marchi
2021-07-12 22:34           ` Simon Marchi
2021-07-13 12:21           ` Pedro Alves
2021-06-22 16:57 ` [PATCH 08/11] gdb: optimize check for resumed threads with pending wait status in maybe_set_commit_resumed_all_targets Simon Marchi
2021-07-05 15:51   ` Pedro Alves
2021-06-22 16:57 ` [PATCH 09/11] gdb: optimize selection of resumed thread with pending event Simon Marchi
2021-07-05 15:51   ` Pedro Alves
2021-06-22 16:57 ` [PATCH 10/11] gdb: maintain ptid -> thread map, optimize find_thread_ptid Simon Marchi
2021-07-05 15:52   ` Pedro Alves
2021-07-06 21:31     ` Simon Marchi
2021-07-07 12:13       ` Pedro Alves
2021-06-22 16:57 ` [PATCH 11/11] gdb: optimize all_matching_threads_iterator Simon Marchi
2021-07-05 15:52   ` Pedro Alves
2021-07-14  9:40     ` Tom de Vries
2021-07-13  0:47 ` [PATCH 00/11] Various thread lists optimizations Simon Marchi

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=de1026cf-5a1a-2024-53b0-07a307a35fbd@polymtl.ca \
    --to=simon.marchi@polymtl.ca \
    --cc=gdb-patches@sourceware.org \
    --cc=pedro@palves.net \
    --cc=simon.marchi@efficios.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).