From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 13100 invoked by alias); 28 Nov 2017 00:39:16 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 13087 invoked by uid 89); 28 Nov 2017 00:39:16 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-0.7 required=5.0 tests=BAYES_00,KAM_LAZY_DOMAIN_SECURITY,KB_WAM_FROM_NAME_SINGLEWORD,SPF_HELO_PASS,T_RP_MATCHES_RCVD autolearn=no version=3.3.2 spammy=strategic, widen X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 28 Nov 2017 00:39:14 +0000 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 457C25D68C; Tue, 28 Nov 2017 00:39:13 +0000 (UTC) Received: from localhost (unused-10-15-17-193.yyz.redhat.com [10.15.17.193]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 1C2145D9C6; Tue, 28 Nov 2017 00:39:13 +0000 (UTC) From: Sergio Durigan Junior To: Tom Tromey Cc: GDB Patches Subject: Re: [PATCH] Implement pahole-like 'ptype /o' option References: <20171121160709.23248-1-sergiodj@redhat.com> <87tvxgvo18.fsf@tromey.com> <87a7z7pkf4.fsf@redhat.com> <87wp2b8j11.fsf@tromey.com> Date: Tue, 28 Nov 2017 00:39:00 -0000 In-Reply-To: <87wp2b8j11.fsf@tromey.com> (Tom Tromey's message of "Mon, 27 Nov 2017 15:16:10 -0700") Message-ID: <87wp2bnsnj.fsf@redhat.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-IsSubscribed: yes X-SW-Source: 2017-11/txt/msg00711.txt.bz2 On Monday, November 27 2017, Tom Tromey wrote: >>>>>> "Sergio" == Sergio Durigan Junior writes: > > Sergio> I think for 'ptype /o' the best would be to stick with 2 levels, because > Sergio> otherwise the output gets too messed up. But I've been thinking about > Sergio> sending another patch to enable the multi-level ptype anyway. > > I see what you mean, though I wonder if it's better to just overflow and > let users with deeply-nested types just widen their terminals. OK, so your idea is to always "un-nest" structures/unions when doing 'ptype /o' (just like pahole.py does). That works for me, but I'd like to hear other opinions as well. > Alternatively the code could wrap_here() at strategic points. Yeah, I'll see if I can do that, but I don't know. >>> ... though the old code's output is kind of confusing, restarting the >>> offset at 0 in the embedded struct. > > Sergio> The way my code is written, it also restarts the offset at 0. Do you > Sergio> think it'd be better to keep using the offset from the outter struct? > > I am not 100% certain but I tend to think it's more understandable to > have the offsets refer to the outermost structure. OK, that can be arranged :-). Thanks, -- Sergio GPG key ID: 237A 54B1 0287 28BF 00EF 31F4 D0EB 7628 65FC 5E36 Please send encrypted e-mail if possible http://sergiodj.net/