From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 8883 invoked by alias); 8 Jan 2010 16:25:31 -0000 Received: (qmail 8868 invoked by uid 22791); 8 Jan 2010 16:25:30 -0000 X-SWARE-Spam-Status: No, hits=-1.1 required=5.0 tests=AWL,BAYES_00,SPF_SOFTFAIL X-Spam-Check-By: sourceware.org Received: from mtaout23.012.net.il (HELO mtaout23.012.net.il) (80.179.55.175) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 08 Jan 2010 16:25:25 +0000 Received: from conversion-daemon.a-mtaout23.012.net.il by a-mtaout23.012.net.il (HyperSendmail v2007.08) id <0KVX00H00S6FZI00@a-mtaout23.012.net.il> for gdb-patches@sourceware.org; Fri, 08 Jan 2010 18:25:22 +0200 (IST) Received: from HOME-C4E4A596F7 ([77.127.222.44]) by a-mtaout23.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0KVX00HXPSA79C50@a-mtaout23.012.net.il>; Fri, 08 Jan 2010 18:25:20 +0200 (IST) Date: Fri, 08 Jan 2010 16:25:00 -0000 From: Eli Zaretskii Subject: Re: [patch][python] Implement Python lazy strings (PR 10705) In-reply-to: <4B4746A7.90309@redhat.com> To: Phil Muldoon Cc: gdb-patches@sourceware.org Reply-to: Eli Zaretskii Message-id: <83vdfca7im.fsf@gnu.org> References: <4B4746A7.90309@redhat.com> 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-01/txt/msg00177.txt.bz2 > Date: Fri, 08 Jan 2010 14:52:23 +0000 > From: Phil Muldoon > > 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.