Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: tromey@redhat.com
Cc: gdb-patches@sourceware.org
Subject: Re: Python pretty-printing [5/6]
Date: Fri, 03 Apr 2009 15:29:00 -0000	[thread overview]
Message-ID: <ueiw9iwqp.fsf@gnu.org> (raw)
In-Reply-To: <m38wmibwq0.fsf@fleche.redhat.com>

> From: Tom Tromey <tromey@redhat.com>
> Date: Thu, 02 Apr 2009 14:56:55 -0600
> 
> This is the main part of the pretty-printing code.

Thanks.

> It adds a new "/r" ("raw") option to the print command family.

But this change in behavior is not documented in the docs patch,
right?

> 2009-04-01  Tom Tromey  <tromey@redhat.com>
> 	    Thiago Jung Bauermann  <bauerman@br.ibm.com>
> 	    Phil Muldoon  <pmuldoon@redhat.com>
> 
> 	* gdb.texinfo (Objfiles In Python): Reference pretty printing.
> 	(Pretty Printing): New node.
> 	(Python API): Update.

Comments:

> +@node Pretty Printing
> +@subsubsection Pretty Printing

Please add a @cindex entry here suitable for this subsection.

> +A pretty-printer is an object that implements a specific interface.
> +There is no predefined base class for pretty-printers.

Is it possible to expand this a bit?  This explanation did not explain
anything to me; I needed to read the whole text below several times,
and then look at the code and think, before I managed to come up with
some vague idea of what this feature offers me, and what I can and
cannot do with it.

> +When printing from the CLI, if the @code{to_string} method exists,
> +then @value{GDBN} will prepend its result to the values returned by
> +@code{children}.

I suggest an example here of what is, or could be, prepended.

> +If this method returns a string, it is printed verbatim.  Otherwise,
> +the result is converted to a @code{gdb.Value}, following the usual
> +algorithm.

If we describe the "usual algorithm" somewhere, a cross-reference here
would be a good idea.

>            Then @value{GDBN} prints this value; this may possibly
> +result in a call to another pretty-printer.  If the result is not
> +convertible to @code{gdb.Value}, an exception is raised.

Should we say what exception is raised?

> +@subsubsection Selecting Pretty-Printers

Please make this a @node, and please add a @cindex entry for it.

>                                       A function on one of these lists
> +takes a single @code{gdb.Value} argument and returns a pretty-printer
> +object conforming to the interface definition above.

I presume that "above" refers to the previous section, right?  If so,
please add a cross-reference.

> +We recommend that you put your core pretty-printers into a versioned
> +python package, and then restrict your auto-loaded code to idempotent
> +behavior -- for example, just @code{import}s of your printer modules,

Please use "---" (3 dashes) for em-dash.

> +@smallexample
> +def register_printers (objfile):
> +    objfile.pretty_printers.add (str_lookup_function)
> +@end smallexample
> +
> +And then the corresponding contents of the auto-load file would be:

I think you want @noindent before "And then ...", because it is
logically a continuation of the previous example, not a new paragraph.


  reply	other threads:[~2009-04-03 15:29 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-04-02 20:57 Tom Tromey
2009-04-03 15:29 ` Eli Zaretskii [this message]
2009-04-09  0:29   ` Tom Tromey
2009-04-04 16:39 ` Thiago Jung Bauermann
2009-04-09  0:52   ` Tom Tromey
2009-04-09 15:00     ` Thiago Jung Bauermann
2009-04-09 15:19       ` Phil Muldoon
2009-04-09 15:41         ` Thiago Jung Bauermann
2009-04-09 16:18           ` Tom Tromey
2009-04-09 15:44       ` Tom Tromey
2009-04-09 19:37     ` Tom Tromey
2009-04-09 22:09       ` Thiago Jung Bauermann
2009-04-09 22:36         ` Tom Tromey
2009-04-07 18:32 ` Joel Brobecker
2009-04-07 18:41   ` Tom Tromey
2009-04-07 20:38     ` Joel Brobecker
2009-04-09  1:08 ` Tom Tromey
2009-04-09  7:40   ` Eli Zaretskii
2009-04-09 16:16     ` Tom Tromey
2009-04-09 16:41       ` Eli Zaretskii

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ueiw9iwqp.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=gdb-patches@sourceware.org \
    --cc=tromey@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox