This is the mail archive of the gdb-patches@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: [PATCH 2/2] gdb: Check element of optimised out vla exists


>>>>> "Andrew" == Andrew Burgess <andrew.burgess@embecosm.com> writes:

Andrew> The third test is included as this might cause GDB to crash without
Andrew> the fix (though undefined behaviour, so, you never know).

This will be nice if we enable -fsanitize=undefined, because in that
case it would cause a test failure.

Andrew> An argument could be made that even for arrays that are in inferior
Andrew> memory, if the upper bound is not defined then we should not try to
Andrew> access the array element

In this case, it seems to me that it's fine for gdb to try to respect
the user's request.  After all, although gdb doesn't know the array
bound, the user might.

Andrew> gdb/ChangeLog:

Andrew> 	* valarith.c (value_subscripted_rvalue): If an array is not in
Andrew> 	memory, and we don't know the upper bound, then we can't know that
Andrew> 	the requested element exists or not.

Andrew> gdb/testsuite/ChangeLog:

Andrew> 	* gdb.base/vla-optimized-out.exp: Add new test.

Thank you.  This is ok.

Tom


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