This is the mail archive of the
gdb-prs@sourceware.org
mailing list for the GDB project.
[Bug python/16286] New: value.string(length = x) broken for common variable length arrays idiom
- From: "dje at google dot com" <sourceware-bugzilla at sourceware dot org>
- To: gdb-prs at sourceware dot org
- Date: Mon, 02 Dec 2013 22:47:05 +0000
- Subject: [Bug python/16286] New: value.string(length = x) broken for common variable length arrays idiom
- Auto-submitted: auto-generated
https://sourceware.org/bugzilla/show_bug.cgi?id=16286
Bug ID: 16286
Summary: value.string(length = x) broken for common variable
length arrays idiom
Product: gdb
Version: HEAD
Status: NEW
Severity: normal
Priority: P2
Component: python
Assignee: unassigned at sourceware dot org
Reporter: dje at google dot com
The fix for PR 16196 broke reading strings of variable length arrays that use
the common idiom of having a trailing 1 byte array at the end of a struct.
struct str
{
int length;
/* Variable length. */
char text[1];
};
(gdb) python xstr = gdb.parse_and_eval('xstr')
(gdb) python print xstr['text'].string (length = xstr['length'])
x
What should happen is that the entire string of length "length" is printed.
Patch and testcase to follow.
--
You are receiving this mail because:
You are on the CC list for the bug.