From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 32011 invoked by alias); 23 May 2011 15:24:02 -0000 Received: (qmail 31992 invoked by uid 22791); 23 May 2011 15:24:00 -0000 X-SWARE-Spam-Status: No, hits=-6.2 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; Mon, 23 May 2011 15:23:46 +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 p4NFNhxd012760 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Mon, 23 May 2011 11:23:43 -0400 Received: from localhost.localdomain (ovpn01.gateway.prod.ext.phx2.redhat.com [10.5.9.1]) by int-mx02.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id p4NFNfsm017632; Mon, 23 May 2011 11:23:41 -0400 From: Phil Muldoon To: Doug Evans Cc: Robert Lupton the Good , gdb Subject: Re: Problem redefining python pretty printers References: <1AAE9F25-87D5-44F0-BCF8-B6C3A5D20203@astro.princeton.edu> Reply-to: pmuldoon@redhat.com X-URL: http://www.redhat.com Date: Mon, 23 May 2011 15:24:00 -0000 In-Reply-To: (Doug Evans's message of "Mon, 23 May 2011 08:05:51 -0700") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable 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: 2011-05/txt/msg00125.txt.bz2 Doug Evans writes: > On Sat, May 21, 2011 at 6:41 PM, Robert Lupton the Good > wrote: >> The routine register is: >>> def register(): >>> =C2=A0 =C2=A0 printer =3D gdb.printing.RegexpCollectionPrettyPrinter("a= fw") >>> =C2=A0 =C2=A0 gdb.printing.register_pretty_printer(gdb, printer) >> >> Any advice on what I'm doing wrong? =C2=A0I suppose I could come up with= a new name each time, but that seems a little clumsy. > > You're not doing anything wrong, per se. > I think we need to handle this use-case though. > gdb could either provide a way to replace an existing pretty-printer > or delete it so that it can be re-added. I guess you could delete it from the (gdb) list directly by using the Python list functions. But that is hacky. I agree on the specific API. I can't remember seeing a bug for this. Is there one? Cheers, Phil