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: [RFA, doc RFA]: New printing module and info/disable/enable commands


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." ?


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