From: Simon Marchi <simon.marchi@polymtl.ca>
To: Matthew Malcomson <hardenedapple@gmail.com>
Cc: gdb-patches@sourceware.org
Subject: Re: [PATCH] fix bug with command `printf "%s\n", $_as_string($pc)`
Date: Mon, 20 Feb 2017 18:20:00 -0000 [thread overview]
Message-ID: <1d49ea752aae175256c0278bf3a999bc@polymtl.ca> (raw)
In-Reply-To: <959cdc8e-1e54-a2e7-53d0-d80aaaea9ea8@gmail.com>
On 2017-02-19 12:32, Matthew Malcomson wrote:
> diff --git a/gdb/python/py-value.c b/gdb/python/py-value.c
> index eb3d307b19..c786f68865 100644
> --- a/gdb/python/py-value.c
> +++ b/gdb/python/py-value.c
> @@ -1615,7 +1615,7 @@ convert_value_from_python (PyObject *obj)
> gdb::unique_xmalloc_ptr<char> s
> = python_string_to_target_string (obj);
> if (s != NULL)
> - value = value_cstring (s.get (), strlen (s.get ()),
> + value = value_cstring (s.get (), strlen (s.get ()) + 1,
> builtin_type_pychar);
> }
> else if (PyObject_TypeCheck (obj, &value_object_type))
This fix looks good to me.
One test (py-mi.exp) needs to be updated though. You can run all the
Python-related tests using:
$ make check TESTS="gdb.python/*.exp"
Normally, the Python tests all pass reliably, unlike some other parts of
the testsuite.
It might also be good to improve gdb.python/py-as-string.exp to include
a test for this bug.
Thanks,
Simon
next prev parent reply other threads:[~2017-02-20 18:20 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-02-19 17:32 Matthew Malcomson
2017-02-20 18:20 ` Simon Marchi [this message]
2017-02-25 11:45 ` Matthew Malcomson
2017-02-25 18:33 ` Simon Marchi
2017-02-25 19:11 ` Matthew Malcomson
2017-02-25 21:33 ` Simon Marchi
2017-02-26 13:20 ` Matthew Malcomson
2017-02-26 14:44 ` Simon Marchi
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=1d49ea752aae175256c0278bf3a999bc@polymtl.ca \
--to=simon.marchi@polymtl.ca \
--cc=gdb-patches@sourceware.org \
--cc=hardenedapple@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