diff options
author | Tom Tromey <tromey@redhat.com> | 2010-09-22 15:51:43 +0000 |
---|---|---|
committer | Tom Tromey <tromey@redhat.com> | 2010-09-22 15:51:43 +0000 |
commit | e84676100400c4e1f63f11bdb4aece31c410460a (patch) | |
tree | 8140c636447b2faad368ef6f7ab40661f79e2383 /gdb/doc | |
parent | ec32282347dc5dbd1d58cbc16427e2e24ca6b14c (diff) | |
download | gdb-e84676100400c4e1f63f11bdb4aece31c410460a.zip gdb-e84676100400c4e1f63f11bdb4aece31c410460a.tar.gz gdb-e84676100400c4e1f63f11bdb4aece31c410460a.tar.bz2 |
* gdb.texinfo (Values From Inferior): Mention Value.__init__.
Diffstat (limited to 'gdb/doc')
-rw-r--r-- | gdb/doc/ChangeLog | 4 | ||||
-rw-r--r-- | gdb/doc/gdb.texinfo | 35 |
2 files changed, 39 insertions, 0 deletions
diff --git a/gdb/doc/ChangeLog b/gdb/doc/ChangeLog index b3ca8af..5a99342 100644 --- a/gdb/doc/ChangeLog +++ b/gdb/doc/ChangeLog @@ -1,3 +1,7 @@ +2010-09-22 Tom Tromey <tromey@redhat.com> + + * gdb.texinfo (Values From Inferior): Mention Value.__init__. + 2010-09-22 Eli Zaretskii <eliz@gnu.org> * gdb.texinfo (Values From Inferior): Clarify that diff --git a/gdb/doc/gdb.texinfo b/gdb/doc/gdb.texinfo index e5be509..07f9ad6 100644 --- a/gdb/doc/gdb.texinfo +++ b/gdb/doc/gdb.texinfo @@ -20780,6 +20780,41 @@ it will just return the static type of the value as in @kbd{ptype foo} 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 |