This is the mail archive of the
gdb-prs@sourceware.org
mailing list for the GDB project.
[Bug python/10664] New: gdb.Value.string() doesn't work for character types wider than 1 byte
- From: "jason dot orendorff at gmail dot com" <sourceware-bugzilla at sourceware dot org>
- To: gdb-prs at sourceware dot org
- Date: 18 Sep 2009 21:34:11 -0000
- Subject: [Bug python/10664] New: gdb.Value.string() doesn't work for character types wider than 1 byte
- Reply-to: sourceware-bugzilla at sourceware dot org
I think the bug is in gdb/python/python-value.c, in valpy_string:
TRY_CATCH (except, RETURN_MASK_ALL)
{
LA_GET_STRING (value, &buffer, &length, &la_encoding);
}
GDB_PY_HANDLE_EXCEPTION (except);
encoding = (user_encoding && *user_encoding) ? user_encoding : la_encoding;
unicode = PyUnicode_Decode (buffer, length, encoding, errors);
PyUnicode_Decode expects `length` to be a byte count. But of LA_GET_STRING,
language.h says, "On completion, *LENGTH will hold the size of the string in
characters."
--
Summary: gdb.Value.string() doesn't work for character types
wider than 1 byte
Product: gdb
Version: archer
Status: UNCONFIRMED
Severity: normal
Priority: P2
Component: python
AssignedTo: unassigned at sourceware dot org
ReportedBy: jason dot orendorff at gmail dot com
CC: gdb-prs at sourceware dot org
http://sourceware.org/bugzilla/show_bug.cgi?id=10664
------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.