From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 14997 invoked by alias); 15 Mar 2010 22:52:20 -0000 Received: (qmail 14983 invoked by uid 22791); 15 Mar 2010 22:52:17 -0000 X-SWARE-Spam-Status: No, hits=-2.1 required=5.0 tests=AWL,BAYES_00 X-Spam-Check-By: sourceware.org Received: from nschwmtas06p.mx.bigpond.com (HELO nschwmtas06p.mx.bigpond.com) (61.9.189.152) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 15 Mar 2010 22:52:13 +0000 Received: from nschwotgx02p.mx.bigpond.com ([58.172.130.100]) by nschwmtas06p.mx.bigpond.com (InterMail vM.7.05.02.08 201-2174-114-118-20080528) with ESMTP id <20100315225210.DBWU1839.nschwmtas06p.mx.bigpond.com@nschwotgx02p.mx.bigpond.com>; Mon, 15 Mar 2010 22:52:10 +0000 Received: from kiwi.contemporary.net.au ([58.172.130.100]) by nschwotgx02p.mx.bigpond.com with ESMTP id <20100315225209.XJTW2131.nschwotgx02p.mx.bigpond.com@kiwi.contemporary.net.au>; Mon, 15 Mar 2010 22:52:09 +0000 Received: from [172.16.100.166] (lapdog.contemporary.net.au [172.16.100.166]) by kiwi.contemporary.net.au (8.14.2/8.14.2) with ESMTP id o2FMq86l020842; Tue, 16 Mar 2010 09:52:08 +1100 Message-ID: <4B9EBA17.6070806@contemporary.net.au> Date: Mon, 15 Mar 2010 22:52:00 -0000 From: Chris Johns User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.9.1.8) Gecko/20100227 Thunderbird/3.0.3 MIME-Version: 1.0 To: Tom Tromey CC: gdb@sourceware.org Subject: Re: Python Pretty printing a struct References: <4B997F28.4050602@contemporary.net.au> <4B9D73C2.9090307@contemporary.net.au> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-RPD-ScanID: Class unknown; VirusThreatLevel unknown, RefID str=0001.0A150203.4B9EBA19.00DC,ss=1,fgs=0 X-SIH-MSG-ID: oxg3EdTuXAD+xDFw3jbvMwd+xAzupHc75JcMWtRmtxsbTFjCucHOPpX9Y94Qg57n0S5ONBCAPGshY7zmXY7RiA== X-IsSubscribed: yes 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: 2010-03/txt/msg00092.txt.bz2 On 16/03/2010 3:38 AM, Tom Tromey wrote: >>>>>> "Chris" == Chris Johns writes: > > Chris> def to_string(self): > Chris> return 'to_string' > > This seems like a strange definition for this method. I am not sure I follow. The 'to_string' text was just to show where the output appeared. > Try removing it. Commenting out the function produced: (gdb) p the_semaphore->Object.id $4 = AttributeError: object_id_printer instance has no attribute 'to_string' = { id = 436273170, node = 1, api = classic, class = semaphores, index = 18 } Trying: def to_string(self): return None and def to_string(self): pass gave: (gdb) p the_semaphore->Object.id $5 = TypeError: Could not convert Python object: None = { id = 436273170, node = 1, api = classic, class = semaphores, index = 18 } > > Chris> Should I raise a bug report ? > > Sure. > Bug #11380. > > This is probably due to http://sourceware.org/bugzilla/show_bug.cgi?id=10660 > Agreed. Chris