From: Tom Tromey Date: Wed, 22 Sep 2010 15:51:43 +0000 (+0000) Subject: * gdb.texinfo (Values From Inferior): Mention Value.__init__. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=e84676100400c4e1f63f11bdb4aece31c410460a;p=binutils-gdb.git * gdb.texinfo (Values From Inferior): Mention Value.__init__. --- diff --git a/gdb/doc/ChangeLog b/gdb/doc/ChangeLog index b3ca8af741f..5a99342a11f 100644 --- a/gdb/doc/ChangeLog +++ b/gdb/doc/ChangeLog @@ -1,3 +1,7 @@ +2010-09-22 Tom Tromey + + * gdb.texinfo (Values From Inferior): Mention Value.__init__. + 2010-09-22 Eli Zaretskii * gdb.texinfo (Values From Inferior): Clarify that diff --git a/gdb/doc/gdb.texinfo b/gdb/doc/gdb.texinfo index e5be50945aa..07f9ad6313b 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