[PATCH 0/2] Accessing array elements of optimised out VLA

Andrew Burgess andrew.burgess@embecosm.com
Wed Aug 1 21:13:00 GMT 2018


I wondered what would happen if you asked GDB for an element from a
VLA that was optimised out.  Turns out the answer is that GDB reads
some random memory from GDB's own address space and gives you that..

...not doing that seemed better.

The first patch is a clean up to merge together 3 almost identical
test scripts.

Thanks,
Andrew

--

Andrew Burgess (2):
  gdb: Merge similar tests into a single test script
  gdb: Check element of optimised out vla exists

 gdb/ChangeLog                                      |  6 +++
 gdb/testsuite/ChangeLog                            | 11 ++++
 .../gdb.base/vla-optimized-out-o3-strict.exp       | 40 ---------------
 gdb/testsuite/gdb.base/vla-optimized-out-o3.exp    | 36 -------------
 gdb/testsuite/gdb.base/vla-optimized-out.exp       | 60 +++++++++++++++++++---
 gdb/valarith.c                                     |  7 ++-
 6 files changed, 74 insertions(+), 86 deletions(-)
 delete mode 100644 gdb/testsuite/gdb.base/vla-optimized-out-o3-strict.exp
 delete mode 100644 gdb/testsuite/gdb.base/vla-optimized-out-o3.exp

-- 
2.14.4



More information about the Gdb-patches mailing list