public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
* [Bug python/16286] New: value.string(length = x) broken for common variable length arrays idiom
@ 2013-12-02 22:47 dje at google dot com
  2013-12-02 22:47 ` [Bug python/16286] " dje at google dot com
                   ` (19 more replies)
  0 siblings, 20 replies; 21+ messages in thread
From: dje at google dot com @ 2013-12-02 22:47 UTC (permalink / raw)
  To: gdb-prs

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.


^ permalink raw reply	[flat|nested] 21+ messages in thread

end of thread, other threads:[~2013-12-19 18:03 UTC | newest]

Thread overview: 21+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-12-02 22:47 [Bug python/16286] New: value.string(length = x) broken for common variable length arrays idiom dje at google dot com
2013-12-02 22:47 ` [Bug python/16286] " dje at google dot com
2013-12-02 23:33 ` dje at google dot com
2013-12-03  1:52 ` asmwarrior at gmail dot com
2013-12-03  2:48 ` brobecker at gnat dot com
2013-12-03  5:16 ` dje at google dot com
2013-12-03  5:20 ` dje at google dot com
2013-12-03  5:23 ` dje at google dot com
2013-12-03 14:35 ` tromey at redhat dot com
2013-12-03 23:30 ` dje at google dot com
2013-12-04  2:29 ` brobecker at adacore dot com
2013-12-04  4:13 ` dje at google dot com
2013-12-11  0:21 ` cvs-commit at gcc dot gnu.org
2013-12-11  0:26 ` dje at google dot com
2013-12-11  9:14 ` brobecker at adacore dot com
2013-12-11 15:25 ` tromey at redhat dot com
2013-12-13 16:52 ` cvs-commit at gcc dot gnu.org
2013-12-19 15:53 ` brobecker at gnat dot com
2013-12-19 16:27 ` xdje42 at gmail dot com
2013-12-19 16:30 ` xdje42 at gmail dot com
2013-12-19 18:03 ` brobecker at adacore dot com

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).