From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 10088 invoked by alias); 10 Mar 2011 21:11:19 -0000 Received: (qmail 10080 invoked by uid 22791); 10 Mar 2011 21:11:19 -0000 X-SWARE-Spam-Status: No, hits=-6.9 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_HI,SPF_HELO_PASS,T_RP_MATCHES_RCVD 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; Thu, 10 Mar 2011 21:11:15 +0000 Received: from int-mx02.intmail.prod.int.phx2.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id p2ALB77X024291 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Thu, 10 Mar 2011 16:11:07 -0500 Received: from ns3.rdu.redhat.com (ns3.rdu.redhat.com [10.11.255.199]) by int-mx02.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id p2ALB6Y5000340; Thu, 10 Mar 2011 16:11:06 -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 p2ALB5EK018574; Thu, 10 Mar 2011 16:11:06 -0500 Received: by opsy.redhat.com (Postfix, from userid 500) id AD1013797CD; Thu, 10 Mar 2011 14:11:05 -0700 (MST) From: Tom Tromey To: Andrew Oakley Cc: =?utf-8?B?QW5kcsOpIFDDtm5pdHo=?= , Joachim Protze , gdb@sourceware.org Subject: Re: Python API - pretty printing complex types References: <20110309004619.7256b052@ado-gentoo> <201103090954.49355.andre.poenitz@nokia.com> <20110309193051.6c757cf5@ado-gentoo> Date: Thu, 10 Mar 2011 21:11:00 -0000 In-Reply-To: <20110309193051.6c757cf5@ado-gentoo> (Andrew Oakley's message of "Wed, 9 Mar 2011 19:30:51 +0000") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org X-SW-Source: 2011-03/txt/msg00082.txt.bz2 >>>>> "Andrew" == Andrew Oakley writes: Andrew> I think it would be nice to be able to return pretty printers from the Andrew> children iterator of another pretty printer. This would allow "phony Andrew> groups" to be created - simply return another pretty printer for the Andrew> group and it will get printed in the usual fashion. Yes, good idea. Andrew> 3. Assume that objects that are not gdb.Value instances are pretty Andrew> printers. This prevents any further extensions from working in the Andrew> same way. Andrew> 4. Assume that objects with a to_string member are pretty printers. Andrew> This is the only required member of pretty printers and seems more in Andrew> line with other python libraries. We probably want to check for this Andrew> after checking if the object was a gdb.Value, both for performance Andrew> reasons and to ensure no existing code has an nasty surprises. Andrew> I think option 4 is the best choice here and I'm happy to write a patch Andrew> to do this if there is some agreement that it is a reasonable decision Andrew> (and therefore might actually get committed). I think either #3 or #4 would be fine. I would approve a clean (well, "clean-enough" :-) implementation of either. If you do plan to implement this, contact me off-list so we can get the paperwork stuff started. If you don't plan to do it, please file it in bugzilla. Tom