From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 24572 invoked by alias); 1 Nov 2010 15:09:23 -0000 Received: (qmail 24564 invoked by uid 22791); 1 Nov 2010 15:09:21 -0000 X-SWARE-Spam-Status: No, hits=-1.9 required=5.0 tests=AWL,BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,SPF_HELO_PASS,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from smtp-out.google.com (HELO smtp-out.google.com) (216.239.44.51) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 01 Nov 2010 15:09:16 +0000 Received: from wpaz17.hot.corp.google.com (wpaz17.hot.corp.google.com [172.24.198.81]) by smtp-out.google.com with ESMTP id oA1F9EDF009892 for ; Mon, 1 Nov 2010 08:09:14 -0700 Received: from gxk2 (gxk2.prod.google.com [10.202.11.2]) by wpaz17.hot.corp.google.com with ESMTP id oA1F9DJM010395 for ; Mon, 1 Nov 2010 08:09:13 -0700 Received: by gxk2 with SMTP id 2so2177386gxk.0 for ; Mon, 01 Nov 2010 08:09:13 -0700 (PDT) MIME-Version: 1.0 Received: by 10.42.171.10 with SMTP id h10mr999198icz.44.1288624152895; Mon, 01 Nov 2010 08:09:12 -0700 (PDT) Received: by 10.220.176.74 with HTTP; Mon, 1 Nov 2010 08:09:12 -0700 (PDT) In-Reply-To: <20101101024704.6A4AA2461AF@ruffy.mtv.corp.google.com> References: <20101101024704.6A4AA2461AF@ruffy.mtv.corp.google.com> Date: Mon, 01 Nov 2010 15:09:00 -0000 Message-ID: Subject: Re: [RFA, doc RFA]: New printing module and info/disable/enable commands From: Doug Evans To: gdb-patches@sourceware.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-System-Of-Record: true X-IsSubscribed: yes 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 X-SW-Source: 2010-11/txt/msg00005.txt.bz2 On Sun, Oct 31, 2010 at 7:47 PM, Doug Evans 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 =A0Doug Evans =A0 > > =A0 =A0 =A0 =A0New python module gdb.printing, and new commands info pret= ty-printer, > =A0 =A0 =A0 =A0enable pretty-printer, disable pretty-printer. > =A0 =A0 =A0 =A0* NEWS: Mention them. > =A0 =A0 =A0 =A0* data-directory/Makefile.in (PYTHON_FILES): Add gdb/print= ing.py, > =A0 =A0 =A0 =A0gdb/command/__init__.py, gdb/command/pretty_printers.py. > =A0 =A0 =A0 =A0* python/lib/gdb/__init__.py: Install pretty-printer comma= nds. > =A0 =A0 =A0 =A0* python/lib/gdb/printing.py: New file. > =A0 =A0 =A0 =A0* python/lib/gdb/command/__init__.py: New file. > =A0 =A0 =A0 =A0* python/lib/gdb/command/pretty_printers.py: New file. > > =A0 =A0 =A0 =A0doc/ > =A0 =A0 =A0 =A0* gdb.texinfo (Pretty Printing): Expand into three section= s, > =A0 =A0 =A0 =A0introduction, example, and commands. > =A0 =A0 =A0 =A0(Python API): Delete section Disabling Pretty-Printers, me= rge into > =A0 =A0 =A0 =A0Selecting Pretty-Printers. > =A0 =A0 =A0 =A0(Writing a Pretty-Printer): New section. =A0Move the prett= y-printer > =A0 =A0 =A0 =A0example here, and reformat to match python coding style. = =A0Add a second > =A0 =A0 =A0 =A0example using the gdb.printing module. > =A0 =A0 =A0 =A0(Python modules): Add gdb.printing. > > =A0 =A0 =A0 =A0testsuite/ > =A0 =A0 =A0 =A0* gdb.python/py-pp-maint.c: New file. > =A0 =A0 =A0 =A0* gdb.python/py-pp-maint.exp: New file. > =A0 =A0 =A0 =A0* 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." ?