From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 18771 invoked by alias); 9 Apr 2009 15:41:27 -0000 Received: (qmail 18511 invoked by uid 22791); 9 Apr 2009 15:41:19 -0000 X-SWARE-Spam-Status: No, hits=-2.7 required=5.0 tests=AWL,BAYES_00,SPF_PASS X-Spam-Check-By: sourceware.org Received: from e24smtp02.br.ibm.com (HELO e24smtp02.br.ibm.com) (32.104.18.86) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 09 Apr 2009 15:41:13 +0000 Received: from d24relay01.br.ibm.com (d24relay01.br.ibm.com [9.8.31.16]) by e24smtp02.br.ibm.com (8.13.1/8.13.1) with ESMTP id n39Fwcx1019587 for ; Thu, 9 Apr 2009 12:58:38 -0300 Received: from d24av01.br.ibm.com (d24av01.br.ibm.com [9.18.232.46]) by d24relay01.br.ibm.com (8.13.8/8.13.8/NCO v9.2) with ESMTP id n39GeRjf3780824 for ; Thu, 9 Apr 2009 13:40:27 -0300 Received: from d24av01.br.ibm.com (loopback [127.0.0.1]) by d24av01.br.ibm.com (8.12.11.20060308/8.13.3) with ESMTP id n39Ff8mQ022470 for ; Thu, 9 Apr 2009 12:41:09 -0300 Received: from [9.8.10.215] ([9.8.10.215]) by d24av01.br.ibm.com (8.12.11.20060308/8.12.11) with ESMTP id n39Ff8IL022465; Thu, 9 Apr 2009 12:41:08 -0300 Subject: Re: Python pretty-printing [5/6] From: Thiago Jung Bauermann To: Phil Muldoon Cc: Tom Tromey , gdb-patches ml In-Reply-To: <49DE11F7.9000501@redhat.com> References: <1238863179.3236.134.camel@localhost.localdomain> <1239289186.30578.18.camel@localhost.localdomain> <49DE11F7.9000501@redhat.com> Content-Type: text/plain; charset="UTF-8" Date: Thu, 09 Apr 2009 15:41:00 -0000 Message-Id: <1239291665.30578.24.camel@localhost.localdomain> Mime-Version: 1.0 Content-Transfer-Encoding: 8bit X-IsSubscribed: yes 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: 2009-04/txt/msg00175.txt.bz2 El jue, 09-04-2009 a las 16:19 +0100, Phil Muldoon escribió: > Thiago Jung Bauermann wrote: > > I found one potential problem, which could cause the function to return > > NULL without an exception being set (it's not the case I thought of > > before, I think): suppose there's no objfile Python object when this > > function is called, to the ALL_OBJFILES loop will skip all objs, then > > the gdb module has no pretty_printers attribute, or the pretty_printers > > value is not a list object. In that case, the function will return NULL > > without a Python exception being set. Can it happen? > > This would require the gdb.pretty_printers attribute in the code to be > changed from a list to something else (or removed for the not existing > scenario). Anyway it would require a conscious code change on behalf of > another author, and not an environmental change. It could happen if > somebody changed the code, but I suspect (in this scenario) it would > fail long before it reached here. I wonder if the pretty printing code in general would be better off manipulating pretty_printers as a Sequence object, instead of a List. After all, the OO people say you never know when you want to change your implementation from a List to a FunkyStringOfObjects. :-) I think me asking this to be changed would be pedantic, though. I agree with you in that there's no real problem here. > I'm in the middle of this right now. I'm putting the finishing touches > on the optional string fetch parameter from the comments posted to the > archer list, and will start work on fixing string output. Awesome! I'm owing you an e-mail reply. Will do right now. -- []'s Thiago Jung Bauermann IBM Linux Technology Center