This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH][PR python/17364] Cleanup registration of __gdb_builtin_type_bound128 pretty-printer
- From: Phil Muldoon <pmuldoon at redhat dot com>
- To: Doug Evans <dje at google dot com>, gdb-patches at sourceware dot org
- Date: Tue, 07 Oct 2014 13:17:10 +0100
- Subject: Re: [PATCH][PR python/17364] Cleanup registration of __gdb_builtin_type_bound128 pretty-printer
- Authentication-results: sourceware.org; auth=none
- References: <yjt21tqn7jvk dot fsf at ruffy dot mtv dot corp dot google dot com>
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 <xdje42@gmail.com>
>
> 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