From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 29406 invoked by alias); 15 Jan 2010 18:13:59 -0000 Received: (qmail 29386 invoked by uid 22791); 15 Jan 2010 18:13:59 -0000 X-SWARE-Spam-Status: No, hits=-2.5 required=5.0 tests=AWL,BAYES_00,SPF_HELO_PASS,SPF_PASS X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 15 Jan 2010 18:13:54 +0000 Received: from int-mx05.intmail.prod.int.phx2.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.18]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id o0FIDBWM021029 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Fri, 15 Jan 2010 13:13:11 -0500 Received: from ns3.rdu.redhat.com (ns3.rdu.redhat.com [10.11.255.199]) by int-mx05.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id o0FIDAfv028591; Fri, 15 Jan 2010 13:13:11 -0500 Received: from opsy.redhat.com (ovpn01.gateway.prod.ext.phx2.redhat.com [10.5.9.1]) by ns3.rdu.redhat.com (8.13.8/8.13.8) with ESMTP id o0FID9wC001378; Fri, 15 Jan 2010 13:13:10 -0500 Received: by opsy.redhat.com (Postfix, from userid 500) id 9B13E37819A; Fri, 15 Jan 2010 11:13:09 -0700 (MST) From: Tom Tromey To: Joel Brobecker Cc: gdb-patches@sourceware.org Subject: Re: [RFC] future gdb-gdb.py things in my pipeline... References: <20100115093910.GD6667@adacore.com> Reply-To: tromey@redhat.com Date: Fri, 15 Jan 2010 18:13:00 -0000 In-Reply-To: <20100115093910.GD6667@adacore.com> (Joel Brobecker's message of "Fri, 15 Jan 2010 13:39:10 +0400") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii 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 X-SW-Source: 2010-01/txt/msg00411.txt.bz2 >>>>> "Joel" == Joel Brobecker writes: Joel> I'll try to think of something generic that allows us: Joel> - exclude certain fields Joel> - print the fields we want in the order we want Joel> - add certain artificial fields? Joel> - other requirements??? If you change the printer to return a container, this problem is a lot simpler. For any field where you just want to see the value as gdb would ordinarily print it, you simply append the field's value: result.append ('fieldname', value['fieldname']) This is simple enough that, IMO, we don't need any extra machinery: * To exclude a field, just don't append it. * To order the fields, append them in the order you want. * To add an artificial field, just append it with whatever name and value you want. Joel> * struct type pretty-printer. Would it make sense to print Joel> the type code and name even if this information is in main_type. Joel> The amount of output generated is still going to be reasonable, Joel> while the extra data could be potentially very useful. Yes please, usually when I print a struct type I want to see the name. Joel> * We need pretty-printers for other GDB types as well. For instance, Joel> a pretty-printer for struct value would be nice... Yeah, that would be handy. Tom