diff options
author | Tom Tromey <tromey@adacore.com> | 2021-04-15 10:14:11 -0600 |
---|---|---|
committer | Tom Tromey <tromey@adacore.com> | 2021-04-15 10:14:11 -0600 |
commit | a15a276b46bf07323a1d270d7abece83ef1ea78f (patch) | |
tree | 742b28318ab95c69c7cdbf446a4439d6e288ea5f /gdb/ChangeLog | |
parent | 644a2e75ace6b5e76f91d38c28c3b97fcfdeeaa5 (diff) | |
download | gdb-a15a276b46bf07323a1d270d7abece83ef1ea78f.zip gdb-a15a276b46bf07323a1d270d7abece83ef1ea78f.tar.gz gdb-a15a276b46bf07323a1d270d7abece83ef1ea78f.tar.bz2 |
Avoid crash in Ada value printing with optimized-out array
The Ada value-printing code could crash when printing an array which
had been optimized out.
The crash is difficult to reproduce, but I did manage to write a test
that at least shows that the previous behavior was incorrect -- before
the patch, the array is printed as if it is valid and every value is 0.
gdb/ChangeLog
2021-04-15 Tom Tromey <tromey@adacore.com>
* ada-valprint.c (ada_value_print_array): Handle optimized-out
arrays.
gdb/testsuite/ChangeLog
2021-04-15 Tom Tromey <tromey@adacore.com>
* gdb.dwarf2/arr-stride.exp: Add test.
Diffstat (limited to 'gdb/ChangeLog')
-rw-r--r-- | gdb/ChangeLog | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 54a035c..5b2f6c9 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,5 +1,10 @@ 2021-04-15 Tom Tromey <tromey@adacore.com> + * ada-valprint.c (ada_value_print_array): Handle optimized-out + arrays. + +2021-04-15 Tom Tromey <tromey@adacore.com> + * printcmd.c (print_variable_and_value): Use common_val_print_checked. |