Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Tom Tromey <tromey@redhat.com>
To: Eli Zaretskii <eliz@gnu.org>
Cc: joel.borggren.franck@gmail.com, andre.poenitz@nokia.com,
	       gdb-patches@sourceware.org
Subject: Re: RFA: document Value.__init__
Date: Tue, 21 Sep 2010 22:50:00 -0000	[thread overview]
Message-ID: <m3tylibw1q.fsf@fleche.redhat.com> (raw)
In-Reply-To: <83wrqex22c.fsf@gnu.org> (Eli Zaretskii's message of "Tue, 21 Sep	2010 22:40:43 +0200")

Eli> OK, but the long list of conversions in the first paragraph could use
Eli> a @table, I think.

How about this?

Tom

2010-09-21  Tom Tromey  <tromey@redhat.com>

	* gdb.texinfo (Values From Inferior): Mention Value.__init__.

Index: gdb.texinfo
===================================================================
RCS file: /cvs/src/src/gdb/doc/gdb.texinfo,v
retrieving revision 1.764
diff -u -r1.764 gdb.texinfo
--- gdb.texinfo	15 Sep 2010 19:31:59 -0000	1.764
+++ gdb.texinfo	21 Sep 2010 21:54:48 -0000
@@ -20774,6 +20774,41 @@
 The following methods are provided:
 
 @table @code
+@defmethod Value __init__ @var{val}
+Many Python values can be converted directly to a @code{gdb.Value} via
+this object initializer.  Specifically:
+
+@table @asis
+@item Python boolean
+A Python boolean is converted to the boolean type from the current
+language.
+
+@item Python integer
+A Python integer is converted to the C @code{long} type for the
+current architecture.
+
+@item Python long
+A Python long is converted to the C @code{long long} type for the
+current architecture.
+
+@item Python float
+A Python float is converted to the C @code{double} type for the
+current architecture.
+
+@item Python string
+A Python string is converted to a target string, using the current
+target encoding.
+
+@item @code{gdb.Value}
+If @code{val} is a @code{gdb.Value}, then a copy of the value is made.
+
+@item @code{gdb.LazyString}
+If @code{val} is a @code{gdb.LazyString} (@pxref{Lazy Strings In
+Python}), then the lazy string's @code{value} method is called, and
+its result is used.
+@end table
+@end defmethod
+
 @defmethod Value cast type
 Return a new instance of @code{gdb.Value} that is the result of
 casting this instance to the type described by @var{type}, which must


  reply	other threads:[~2010-09-21 21:56 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <AANLkTim24XZssayO6-wvf9WoywRauqXRbUdQi5LjyO9F@mail.gmail.com>
     [not found] ` <m3iq26x548.fsf@fleche.redhat.com>
     [not found]   ` <AANLkTi=cBL9Cwu5NeX5yVupXwDbam0j3_gXFPGs0WXgz@mail.gmail.com>
     [not found]     ` <201009161148.37670.andre.poenitz@nokia.com>
     [not found]       ` <AANLkTinqU_uKORndRP7A8Ouy406TOb6WKz8y1eiOHDGP@mail.gmail.com>
     [not found]         ` <m3wrqlpkpd.fsf@fleche.redhat.com>
     [not found]           ` <AANLkTi=JBFao0sFtB+yKesANUqGWKLxX40St782jS1zN@mail.gmail.com>
2010-09-21 21:56             ` RFA: document Value.__init__ (Was: Python API questions and use cases) Tom Tromey
2010-09-21 22:49               ` Eli Zaretskii
2010-09-21 22:50                 ` Tom Tromey [this message]
2010-09-22 16:17                   ` RFA: document Value.__init__ 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=m3tylibw1q.fsf@fleche.redhat.com \
    --to=tromey@redhat.com \
    --cc=andre.poenitz@nokia.com \
    --cc=eliz@gnu.org \
    --cc=gdb-patches@sourceware.org \
    --cc=joel.borggren.franck@gmail.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