This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [RFA, doc RFA]: New printing module and info/disable/enable commands
- From: Doug Evans <dje at google dot com>
- To: gdb-patches at sourceware dot org
- Date: Mon, 1 Nov 2010 08:09:12 -0700
- Subject: Re: [RFA, doc RFA]: New printing module and info/disable/enable commands
- References: <20101101024704.6A4AA2461AF@ruffy.mtv.corp.google.com>
On Sun, Oct 31, 2010 at 7:47 PM, Doug Evans <dje@google.com> wrote:
> Hi.
>
> This patch adds two things: A new python module to assist in writing
> pretty-printers (mostly to formalize some of the administrivia aspects
> to support the new commands), and three new commands:
> info|enable|disable pretty-printer.
>
> This is a revised version of the patch I posted earlier
> (several months ago IIRC).
>
> Ok to check in?
>
> 2010-10-31 ?Doug Evans ?<dje@google.com>
>
> ? ? ? ?New python module gdb.printing, and new commands info pretty-printer,
> ? ? ? ?enable pretty-printer, disable pretty-printer.
> ? ? ? ?* NEWS: Mention them.
> ? ? ? ?* data-directory/Makefile.in (PYTHON_FILES): Add gdb/printing.py,
> ? ? ? ?gdb/command/__init__.py, gdb/command/pretty_printers.py.
> ? ? ? ?* python/lib/gdb/__init__.py: Install pretty-printer commands.
> ? ? ? ?* python/lib/gdb/printing.py: New file.
> ? ? ? ?* python/lib/gdb/command/__init__.py: New file.
> ? ? ? ?* python/lib/gdb/command/pretty_printers.py: New file.
>
> ? ? ? ?doc/
> ? ? ? ?* gdb.texinfo (Pretty Printing): Expand into three sections,
> ? ? ? ?introduction, example, and commands.
> ? ? ? ?(Python API): Delete section Disabling Pretty-Printers, merge into
> ? ? ? ?Selecting Pretty-Printers.
> ? ? ? ?(Writing a Pretty-Printer): New section. ?Move the pretty-printer
> ? ? ? ?example here, and reformat to match python coding style. ?Add a second
> ? ? ? ?example using the gdb.printing module.
> ? ? ? ?(Python modules): Add gdb.printing.
>
> ? ? ? ?testsuite/
> ? ? ? ?* gdb.python/py-pp-maint.c: New file.
> ? ? ? ?* gdb.python/py-pp-maint.exp: New file.
> ? ? ? ?* gdb.python/py-pp-maint.py: New file.
There's one aspect of the coding standards that I violate here, which
I forgot to mention and bring up for discussion.
I added this to the python coding standards in gdbint.texinfo based on
discussions in IRC:
"Use @code{FIXME} instead of @code{TODO}."
There are two issues with this:
- the meaning of the two words can be quite different
- new FIXMEs are prohibited in gdb in the first place
This raises two questions:
1) What's the proper way to document thoughts on future improvements?
This matters to the current patch here:
+ def list_pretty_printers(self, pretty_printers, name_re, subname_re):
+ """Print a list of pretty-printers."""
+ # TODO: Provide option to list printers in "lookup order"
+ # (i.e. unsorted).
The option is not present in the current patch for fear of feechuritis.
2) Should I reword the above text in gdbint.texinfo to say
"TODO is prohibited." ?