From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 3239 invoked by alias); 7 Oct 2014 12:17:16 -0000 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 Received: (qmail 3228 invoked by uid 89); 7 Oct 2014 12:17:16 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-3.7 required=5.0 tests=AWL,BAYES_00,SPF_HELO_PASS,T_RP_MATCHES_RCVD autolearn=ham version=3.3.2 X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-GCM-SHA384 encrypted) ESMTPS; Tue, 07 Oct 2014 12:17:14 +0000 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id s97CHCop032116 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Tue, 7 Oct 2014 08:17:12 -0400 Received: from localhost.localdomain (ovpn-112-17.ams2.redhat.com [10.36.112.17]) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id s97CHAkH002416; Tue, 7 Oct 2014 08:17:11 -0400 Message-ID: <5433D9C6.5030202@redhat.com> Date: Tue, 07 Oct 2014 12:17:00 -0000 From: Phil Muldoon MIME-Version: 1.0 To: Doug Evans , gdb-patches@sourceware.org Subject: Re: [PATCH][PR python/17364] Cleanup registration of __gdb_builtin_type_bound128 pretty-printer References: In-Reply-To: Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-IsSubscribed: yes X-SW-Source: 2014-10/txt/msg00108.txt.bz2 On 04/10/14 19:46, Doug Evans wrote: > Hi. > > The registration of this pretty-printer is all wrong. > This patch creates a new global "builtin" collection of pretty-printers, > adds the bound pretty-printer to it, and provides an API call > to let one register more builtin pretty-printers. > > I'd really like to get this into 7.8.1, > I don't want the way it is currently registered to get built on. > > One thing that still bothers me is that the bound128 type is > x86-specific and yet the printer is arch-independent. > That should require changing the name __gdb_builtin_type_bound128 > in i386-tdep.c to include x86 in the name (or some such), > but maybe that's too big a change for now. > But as gdb becomes more multi-arch, attention to collisions and confusion > in global namespaces (e.g., the space of builtin pretty-printers) > is going to be more important. > [One way to solve this would be to record such printers with > the arch, but that feels like overkill.] > > 2014-10-03 Doug Evans > > PR python/17364 > * python/lib/gdb/__init__.py (packages): Add "printer". > * python/lib/gdb/command/bound_registers.py: Moved to ... > * python/lib/gdb/printer/bound_registers.py: ... here. > Add printer to global set of builtin printers. Rename printer from > "bound" to "bound128". > * python/lib/gdb/printing.py (_builtin_pretty_printers): New global, > registered as global "builtin" printer. > (add_builtin_pretty_printer): New function. > * data-directory/Makefile.in (PYTHON_FILE_LIST): Update, and add > gdb/printer/__init__.py. Doug, Looks fine to me. I kind of like the idea of a more specific "printer" based package for commands or functions that only specifically relate to printers. Cheers Phil