]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commit - gdb/ChangeLog
Do not auto-dereference null pointers in Ada MI varobj
authorTom Tromey <tromey@adacore.com>
Mon, 10 Aug 2020 11:21:06 +0000 (05:21 -0600)
committerTom Tromey <tromey@adacore.com>
Wed, 2 Sep 2020 17:30:51 +0000 (11:30 -0600)
commit02c6f3f1fc2af7ad02bc649f0adfb479bf163441
treebd8d8af76bc483e61c5c330f3cf106a752c8281f
parent7c80dd4c2cc080036b95176bcf35bb6f46355598
Do not auto-dereference null pointers in Ada MI varobj

The Ada varobj code automatically dereferences access types.  This is
often handy, but it also does so for null pointers -- showing children
with empty values.

These children are weird, but even weirder when a variant type is
involved, because only the non-varying parts of the type are
displayed.  This behavior conflicts a bit with my ongoing quest to
move the Ada code to use DWARF rather than gnat encodings, in that
reproducing this behavior with the DWARF code seems rather hacky.

So, this patch instead changes the Ada varobj code so that it does not
automatically dereference null pointers.

As this patch only affects Ada, and it was already reviewed internally
by Joel, I am checking it in.

2020-09-02  Tom Tromey  <tromey@adacore.com>

* ada-varobj.c (ada_varobj_get_ptr_number_of_children): Return 0
for null pointers.
(ada_varobj_adjust_for_child_access): Special-case null pointers.

gdb/testsuite/ChangeLog
2020-09-02  Tom Tromey  <tromey@adacore.com>

* gdb.ada/mi_var_access.exp: Test children of access variable.
* gdb.ada/mi_var_access/mi_access.adb: Add new stop markers.
* gdb.ada/mi_var_array.exp: Update.
gdb/ChangeLog
gdb/ada-varobj.c
gdb/testsuite/ChangeLog
gdb/testsuite/gdb.ada/mi_var_access.exp
gdb/testsuite/gdb.ada/mi_var_access/mi_access.adb
gdb/testsuite/gdb.ada/mi_var_array.exp