diff options
author | Thiago Jung Bauermann <bauerman@br.ibm.com> | 2009-02-05 21:16:09 +0000 |
---|---|---|
committer | Thiago Jung Bauermann <bauerman@br.ibm.com> | 2009-02-05 21:16:09 +0000 |
commit | b6cb8e7dead0c48df80c28f95ee7543799672d11 (patch) | |
tree | d6a9f0104500adf91e8ba8f95d7e9e35444ab026 /gdb/doc | |
parent | 54ba13f733396d107167bf89afd43db66bebe779 (diff) | |
download | gdb-b6cb8e7dead0c48df80c28f95ee7543799672d11.zip gdb-b6cb8e7dead0c48df80c28f95ee7543799672d11.tar.gz gdb-b6cb8e7dead0c48df80c28f95ee7543799672d11.tar.bz2 |
gdb/
2009-02-05 Thiago Jung Bauermann <bauerman@br.ibm.com>
Tom Tromey <tromey@redhat.com>
* python/python-utils.c (target_string_to_unicode): New function.
* python/python-internal.h (target_string_to_unicode): New prototype.
* python/python-value.c (valpy_string): New function.
(value_object_methods): Add `string' entry.
gdb/doc/
2009-02-05 Tom Tromey <tromey@redhat.com>
* gdb.texinfo (Values From Inferior): Document Value.string.
Diffstat (limited to 'gdb/doc')
-rw-r--r-- | gdb/doc/ChangeLog | 4 | ||||
-rw-r--r-- | gdb/doc/gdb.texinfo | 27 |
2 files changed, 31 insertions, 0 deletions
diff --git a/gdb/doc/ChangeLog b/gdb/doc/ChangeLog index a23fa1f..0f5363c 100644 --- a/gdb/doc/ChangeLog +++ b/gdb/doc/ChangeLog @@ -1,5 +1,9 @@ 2009-02-05 Tom Tromey <tromey@redhat.com> + * gdb.texinfo (Values From Inferior): Document Value.string. + +2009-02-05 Tom Tromey <tromey@redhat.com> + * gdb.texinfo (Basic Python): Document execute's from_tty argument. diff --git a/gdb/doc/gdb.texinfo b/gdb/doc/gdb.texinfo index 99e5248..a2ed0b8 100644 --- a/gdb/doc/gdb.texinfo +++ b/gdb/doc/gdb.texinfo @@ -18219,6 +18219,33 @@ The result @code{bar} will be a @code{gdb.Value} object holding the value pointed to by @code{foo}. @end defmethod +@defmethod Value string @r{[}encoding @r{[}errors@r{]}@r{]} +If this @code{gdb.Value} represents a string, then this method +converts the contents to a Python string. Otherwise, this method will +throw an exception. + +Strings are recognized in a language-specific way; whether a given +@code{gdb.Value} represents a string is determined by the current +language. + +For C-like languages, a value is a string if it is a pointer to or an +array of characters or ints. The string is assumed to be terminated +by a zero of the appropriate width. + +If the optional @var{encoding} argument is given, it must be a string +naming the encoding of the string in the @code{gdb.Value}, such as +@code{"ascii"}, @code{"iso-8859-6"} or @code{"utf-8"}. It accepts +the same encodings as the corresponding argument to Python's +@code{string.decode} method, and the Python codec machinery will be used +to convert the string. If @var{encoding} is not given, or if +@var{encoding} is the empty string, then either the @code{target-charset} +(@pxref{Character Sets}) will be used, or a language-specific encoding +will be used, if the current language is able to supply one. + +The optional @var{errors} argument is the same as the corresponding +argument to Python's @code{string.decode} method. +@end defmethod + @node Interpreters @chapter Command Interpreters @cindex command interpreters |