From: Tom Tromey <tromey@redhat.com>
To: "Joel Borggrén-Franck" <joel.borggren.franck@gmail.com>
Cc: "André Pönitz" <andre.poenitz@nokia.com>, gdb-patches@sourceware.org
Subject: RFA: document Value.__init__ (Was: Python API questions and use cases)
Date: Tue, 21 Sep 2010 21:56:00 -0000 [thread overview]
Message-ID: <m3pqw6eua9.fsf_-_@fleche.redhat.com> (raw)
In-Reply-To: <AANLkTi=JBFao0sFtB+yKesANUqGWKLxX40St782jS1zN@mail.gmail.com> ("Joel =?utf-8?Q?Borggr=C3=A9n-Franck=22's?= message of "Fri, 17 Sep 2010 09:35:09 +0200")
>>>>> "Joel" == Joel Borggrén-Franck <joel.borggren.franck@gmail.com> writes:
Joel> I can't find documentation for the constructor André showed me:
Joel> gdb.Value(addr).
Here is a patch to document this constructor.
Ok?
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 20:05:54 -0000
@@ -20774,6 +20774,22 @@
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, Python booleans are converted
+to boolean type from the current language; Python integers are
+converted to the C @code{long} type for the current architecture;
+Python longs are converted to the C @code{long long} type for the
+current architecture; Python floats are converted to the C
+@code{double} type for the current architecture; and Python strings
+are converted to target strings, using the current target encoding.
+
+@code{val} can also be a @code{gdb.Value}, in which case a copy of the
+value is returned, or a @code{gdb.LazyString} (@pxref{Lazy Strings In
+Python}), in which case the lazy string's @code{value} method is
+called, and its result is returned.
+@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
next parent reply other threads:[~2010-09-21 20:06 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 ` Tom Tromey [this message]
2010-09-21 22:49 ` Eli Zaretskii
2010-09-21 22:50 ` RFA: document Value.__init__ Tom Tromey
2010-09-22 16:17 ` 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=m3pqw6eua9.fsf_-_@fleche.redhat.com \
--to=tromey@redhat.com \
--cc=andre.poenitz@nokia.com \
--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