From: Pedro Alves <palves@redhat.com>
To: Phil Muldoon <pmuldoon@redhat.com>,
Michael Stahl <mstahl@redhat.com>,
gdb@gnu.org, Doug Evans <dje@google.com>,
Doug Evans <xdje42@gmail.com>
Subject: Re: gdb 8.0 "lazy_string" exception "Length is larger than array size"
Date: Tue, 26 Sep 2017 10:30:00 -0000 [thread overview]
Message-ID: <28211a38-604b-a775-598b-677ddf46673a@redhat.com> (raw)
In-Reply-To: <a8fbe6d5-08f8-47ee-75c1-62a9b380d337@redhat.com>
On 09/26/2017 08:56 AM, Phil Muldoon wrote:
> On 25/09/17 18:20, Michael Stahl wrote:
> This code was added at 34b433203b5 by Doug Evans and
> it was noted it was a bug. I've not sure, though, fixing this bug
> may have had unintended consequences. I've CC'd Doug on the patch
> and maybe he could comment further.
We could perhaps decide to special case trailing arrays of
lengths 0 and 1 (i.e., let the caller request more elements than
declared), assuming they're being used as the trailing array
idiom, similarly to how gcc also has special concessions for those.
I don't know off hand whether its easy for the gdb code in question
to tell whether the array is the last field of a struct, though
I'd assume not.
If you want to ignore the array's declared length, I think you can
always decay 'buffer' to a pointer and work with that, and then GDB
won't have a length to validate.
Thanks,
Pedro Alves
next prev parent reply other threads:[~2017-09-26 10:30 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-09-25 19:55 Michael Stahl
2017-09-26 7:56 ` Phil Muldoon
2017-09-26 8:06 ` Fwd: " Phil Muldoon
2017-09-26 10:30 ` Pedro Alves [this message]
2017-09-29 15:06 ` Michael Stahl
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=28211a38-604b-a775-598b-677ddf46673a@redhat.com \
--to=palves@redhat.com \
--cc=dje@google.com \
--cc=gdb@gnu.org \
--cc=mstahl@redhat.com \
--cc=pmuldoon@redhat.com \
--cc=xdje42@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