Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Phil Muldoon <pmuldoon@redhat.com>
Cc: gdb-patches@sourceware.org
Subject: Re: [patch][python] Implement Python lazy strings (PR 10705)
Date: Fri, 08 Jan 2010 16:25:00 -0000	[thread overview]
Message-ID: <83vdfca7im.fsf@gnu.org> (raw)
In-Reply-To: <4B4746A7.90309@redhat.com>

> Date: Fri, 08 Jan 2010 14:52:23 +0000
> From: Phil Muldoon <pmuldoon@redhat.com>
> 
> This patch implements Python lazy strings, and also alters the Python
> pretty-printing process to handle them accordingly.

Thanks.

> Index: gdb/doc/gdb.texinfo
> ===================================================================
> RCS file: /cvs/src/src/gdb/doc/gdb.texinfo,v
> retrieving revision 1.656
> diff -u -r1.656 gdb.texinfo
> --- gdb/doc/gdb.texinfo	6 Jan 2010 20:31:28 -0000	1.656
> +++ gdb/doc/gdb.texinfo	8 Jan 2010 14:22:47 -0000

A few comments about this part.

> +If the optional @var{encoding} argument is given, it must be a string
> +naming the encoding of the @code{gdb.LazyString}. Some examples are:
                                                   ^^
Two spaces, please.

> +@code{"ascii"}, @code{"iso-8859-6"} or @code{"utf-8"}.

@code{"foo"} looks funny in the Info manual (because @code encloses
its argument in another pair of quotes.  I suggest @samp{ascii}
etc. (without quotes) instead.  (Yes, I know we use @code{"foo"}
elsewhere in the manual; they need to be fixed as well.)

> +When a lazy string is printed, the @value{GDBN} codec machinery is
> +used to convert the string during printing.

We don't use ``codec'' for GDB encodings.  I suggest to use
``encoding'' here, and perhaps also add a @pxref to the section where
that is described.

> If @var{encoding} is set to @code{None}

Is it None or "None" (a string)?  If the former, then your original
statement that it should be a string, seems to be inaccurate.

> or if @var{encoding} is an empty string,
> +@value{GDBN} will automatically select the encoding most suitable for
> +the string type.

This leaves me wondering what will happen if I don't specify the
encoding at all, and how is that different from specifying None.

Also, what happens if the encoding is not known or not supported by
GDB?

> +If the optional @var{length} argument is given, the string will be
> +fetched and encoded to the length of characters specified.
                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^
"to the number of characters" is better, I think.  By the way, does it
count characters or bytes?

> +@node Lazy Strings In Python
> +@subsubsection Python representation of lazy strings.
> +
> +@cindex lazy strings in python
> +@tindex gdb.LazyString

It would be good to say here what is a lazy string, before you start
using it to explain other matters.  Something like

  A @dfn{lazy string} is a string whose contents is not produced until
  it is needed.

> +A @code{gdb.LazyString} can be defined as an @code{address} that

"can be defined" or "is represented in GDB"?  That is, you are
describing the actual implementation, not a possibility, right?

> +@defivar LazyString type
> +This attribute holds the type that is represented by the lazy string's
> +type.  This attribute is not writable.
> +@end defivar

What could be a type of a string, except string?  I think the possible
types should be stated here.


  reply	other threads:[~2010-01-08 16:25 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-01-08 14:52 Phil Muldoon
2010-01-08 16:25 ` Eli Zaretskii [this message]
2010-01-11 15:40   ` Phil Muldoon
2010-01-11 19:10     ` Eli Zaretskii
2010-01-11 21:08 ` Tom Tromey
2010-01-11 21:30   ` Phil Muldoon
2010-01-11 21:40     ` Phil Muldoon
2010-01-12 17:02     ` Tom Tromey
2010-01-13 14:49   ` Phil Muldoon
2010-01-13 18:13     ` Tom Tromey
2010-01-13 20:23       ` Phil Muldoon
2010-01-13 20:33         ` Tom Tromey
2010-01-14 21:24           ` Phil Muldoon
2010-01-13 18:24     ` 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=83vdfca7im.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=gdb-patches@sourceware.org \
    --cc=pmuldoon@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