public inbox for archer-commits@sourceware.org help / color / mirror / Atom feed
From: tromey@sourceware.org To: archer-commits@sourceware.org Subject: [SCM] archer-tromey-python: gdb Date: Tue, 02 Dec 2008 21:29:00 -0000 [thread overview] Message-ID: <20081202212930.15483.qmail@sourceware.org> (raw) The branch, archer-tromey-python has been updated via 34a2d37155617498485e65ba9d1964785274e7f1 (commit) from 949f9573fce69b4516501c9b9c67cc189ce82b09 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email. - Log ----------------------------------------------------------------- commit 34a2d37155617498485e65ba9d1964785274e7f1 Author: Tom Tromey <tromey@redhat.com> Date: Tue Dec 2 14:28:58 2008 -0700 gdb * python/python-value.c (valpy_string): Add "errors" argument. gdb/doc * gdb.texinfo (Values From Inferior): Document new string argument. ----------------------------------------------------------------------- Summary of changes: gdb/ChangeLog | 4 ++++ gdb/doc/ChangeLog | 5 +++++ gdb/doc/gdb.texinfo | 11 ++++++++--- gdb/python/python-value.c | 7 ++++--- 4 files changed, 21 insertions(+), 6 deletions(-) First 500 lines of diff: diff --git a/gdb/ChangeLog b/gdb/ChangeLog index daa5586..f8287c0 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,5 +1,9 @@ 2008-12-02 Tom Tromey <tromey@redhat.com> + * python/python-value.c (valpy_string): Add "errors" argument. + +2008-12-02 Tom Tromey <tromey@redhat.com> + * python/lib/gdb/command/backtrace.py (FrameWrapper.__getattr__): Rename from __getattribute__. * python/lib/gdb/backtrace.py (push_frame_filter): Add missing diff --git a/gdb/doc/ChangeLog b/gdb/doc/ChangeLog index 703543b..a786ea1 100644 --- a/gdb/doc/ChangeLog +++ b/gdb/doc/ChangeLog @@ -1,3 +1,8 @@ +2008-12-02 Tom Tromey <tromey@redhat.com> + + * gdb.texinfo (Values From Inferior): Document new string + argument. + 2008-12-01 Tom Tromey <tromey@redhat.com> * gdb.texinfo (Basic Python): Document parse_and_eval. diff --git a/gdb/doc/gdb.texinfo b/gdb/doc/gdb.texinfo index dfc19aa..1e7a22d 100644 --- a/gdb/doc/gdb.texinfo +++ b/gdb/doc/gdb.texinfo @@ -18247,7 +18247,7 @@ 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{]} +@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. @@ -18263,8 +18263,13 @@ 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}. The Python codec machinery will be used to convert the string. If @var{encoding} -is not given, then the @code{target-charset} (@pxref{Character Sets}) -will be used. +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 @defmethod Value type diff --git a/gdb/python/python-value.c b/gdb/python/python-value.c index 5a7fae0..342cf28 100644 --- a/gdb/python/python-value.c +++ b/gdb/python/python-value.c @@ -165,10 +165,11 @@ valpy_string (PyObject *self, PyObject *args) volatile struct gdb_exception except; PyObject *unicode; const char *encoding = NULL; + const char *errors = NULL; const char *user_encoding = NULL; const char *la_encoding = NULL; - if (!PyArg_ParseTuple (args, "|s", &user_encoding)) + if (!PyArg_ParseTuple (args, "|ss", &user_encoding, &errors)) return NULL; TRY_CATCH (except, RETURN_MASK_ALL) @@ -187,8 +188,8 @@ valpy_string (PyObject *self, PyObject *args) return NULL; } - encoding = user_encoding? user_encoding : la_encoding; - unicode = PyUnicode_Decode (buffer, length, encoding, NULL); + encoding = (user_encoding && *user_encoding) ? user_encoding : la_encoding; + unicode = PyUnicode_Decode (buffer, length, encoding, errors); xfree (buffer); return unicode; hooks/post-receive -- Repository for Project Archer.
next reply other threads:[~2008-12-02 21:29 UTC|newest] Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top 2008-12-02 21:29 tromey [this message] -- strict thread matches above, loose matches on Subject: below -- 2009-04-07 20:28 tromey 2009-03-24 17:27 tromey 2009-02-05 19:56 tromey 2008-12-17 23:10 tromey 2008-12-15 22:38 tromey 2008-12-13 0:37 tromey 2008-12-12 23:54 tromey 2008-12-10 15:28 tromey 2008-12-09 0:33 tromey 2008-12-01 19:10 tromey 2008-11-25 21:17 tromey 2008-11-21 18:25 tromey 2008-11-18 18:52 tromey 2008-11-18 15:54 tromey 2008-11-17 15:45 tromey 2008-11-16 22:18 tromey 2008-11-16 16:56 tromey 2008-11-12 1:54 tromey 2008-11-10 14:15 tromey 2008-11-06 21:11 tromey 2008-11-06 19:58 tromey 2008-10-23 22:27 tromey 2008-10-23 21:28 tromey 2008-10-22 18:18 tromey 2008-10-21 18:32 tromey
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=20081202212930.15483.qmail@sourceware.org \ --to=tromey@sourceware.org \ --cc=archer-commits@sourceware.org \ /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: linkBe 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; as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).