This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [RFC] new commands: info pretty-printers, enable/disable pretty-printer


On Tue, Jun 8, 2010 at 12:33 PM, Doug Evans <dje@google.com> wrote:
> Hi.
>
> This patch provides a convention for naming pretty printers,
> adds support for the common case of using a regexp on the type name,
> and adds 3 new commands, written in python:
>
> info pretty-printers [obj-regexp [name-regexp [subname-regexp]]]
> enable pretty-printer [obj-regexp [name-regexp [subname-regexp]]]
> disable pretty-printer [obj-regexp [name-regexp [subname-regexp]]]
>
> obj-regexp is used to denote which pretty-printer list:
> gdb, current-progspace, or objfile.
> name-regexp is the name of the pretty-printer, e.g. for libstdc++
> it could be "libstdc++".
> subname-regexp is there because one "pretty-printer" can print an
> arbitrary number of types.
>
> This is just a strawman. ?[No NEWS, docs, this is just RFC.]
> How *do* we want this to work, if at all?
> Comments?
>
>
> The testcase punts on testing this when build != host.
> The preferred way of testing this is to set up a python module library
> on the [possibly) remote host, but I can't find support in dejagnu for
> setting up directories on the remote host (perhaps I missed it of course).
>
> Example from the testcase:
>
> (gdb) info pretty-printers
> global pretty-printers:
> ? ?pp-test
> ? ? ?^struct s$
> ? ? ?^s$
> ? ? ?^struct ss$
> ? ? ?^ss$
> (gdb) disable pretty-printer global pp-test .*
> 4 printers disabled
> 0 printers enabled, 4 total printers
> (gdb) enable pretty-printer global pp-test .*
> 4 printers enabled
> 4 printers enabled, 4 total printers
>
> [The output of `enable' is a bit klunky, I figure that's the least
> of my worries ...]

This patch is a minor improvement.
It's still a strawman.  Comments?


2010-06-11  Doug Evans  <dje@google.com>

        Give pretty-printers names.  Add new commands:
        info pretty-printers, enable|disable pretty-printer
        * python/lib/gdb/printing.py: New file.

        testsuite/
        * gdb.python/py-pp-maint.c: New file.
        * gdb.python/py-pp-maint.py: New file.
        * gdb.python/py-pp-maint.exp: New file.

Attachment: gdb-100611-info-pretty-printers-2.patch.txt
Description: Text document


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]