This is the mail archive of the gdb@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: gdb 8.0 "lazy_string" exception "Length is larger than array size"


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]