From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id X/T/BBOy5WAjYAAAWB0awg (envelope-from ) for ; Wed, 07 Jul 2021 09:54:27 -0400 Received: by simark.ca (Postfix, from userid 112) id 065F01F1F2; Wed, 7 Jul 2021 09:54:27 -0400 (EDT) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-0.7 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,MAILING_LIST_MULTI,RDNS_DYNAMIC,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 Received: from sourceware.org (ip-8-43-85-97.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 388BF1F1EE for ; Wed, 7 Jul 2021 09:54:26 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 613073953421 for ; Wed, 7 Jul 2021 13:54:23 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 613073953421 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1625666063; bh=q6ziAw9NO8VS9RFtSlZrbvWBAmkvrTPK1blpYf0ywjs=; h=Subject:To:References:Date:In-Reply-To:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc: From; b=CwHOyOkwLgw0RWpgDq9moe6Lxs3NBUZY9jxTejqNPQK4SW00nPDUg+2WNIQE77bNU twCsZcwWwOUc0t+gdmaLB/CmHMGpVeZvBNxUSyXc3ploFx8+I30n6mJuFVroww6mca 1opSweqxo/Lhb0shQRB8FPUT1yN8h0Kfxkk9a4iI= Received: from smtp.polymtl.ca (smtp.polymtl.ca [132.207.4.11]) by sourceware.org (Postfix) with ESMTPS id 3ED383953C02 for ; Wed, 7 Jul 2021 13:53:01 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 3ED383953C02 Received: from simark.ca (simark.ca [158.69.221.121]) (authenticated bits=0) by smtp.polymtl.ca (8.14.7/8.14.7) with ESMTP id 167Dqqa3003551 (version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 7 Jul 2021 09:52:57 -0400 DKIM-Filter: OpenDKIM Filter v2.11.0 smtp.polymtl.ca 167Dqqa3003551 Received: from [10.0.0.11] (192-222-157-6.qc.cable.ebox.net [192.222.157.6]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by simark.ca (Postfix) with ESMTPSA id 977DA1F1EE; Wed, 7 Jul 2021 09:52:52 -0400 (EDT) Subject: Re: [PATCH 02/11] gdb: introduce intrusive_list, make thread_info use it To: Pedro Alves , gdb-patches@sourceware.org References: <20210622165704.2404007-1-simon.marchi@polymtl.ca> <20210622165704.2404007-3-simon.marchi@polymtl.ca> <2466c5e0-36f4-ce47-f05f-022cda04bb04@palves.net> <3707d3e0-3166-cee1-dabd-cb101807c01e@polymtl.ca> <00b850dc-6d17-1651-e8d2-4712d03950b8@palves.net> Message-ID: Date: Wed, 7 Jul 2021 09:52:52 -0400 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.11.0 MIME-Version: 1.0 In-Reply-To: <00b850dc-6d17-1651-e8d2-4712d03950b8@palves.net> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Poly-FromMTA: (simark.ca [158.69.221.121]) at Wed, 7 Jul 2021 13:52:52 +0000 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: , From: Simon Marchi via Gdb-patches Reply-To: Simon Marchi Cc: Simon Marchi Errors-To: gdb-patches-bounces+public-inbox=simark.ca@sourceware.org Sender: "Gdb-patches" 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