binutils-gdb/gdb/testsuite/gdb.ada
Tom Tromey 02c6f3f1fc 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.
2020-09-02 11:30:51 -06:00
..
access_tagged_param
access_to_packed_array
access_to_unbounded_array
addr_arith
aliased_array
arr_acc_idx_w_gap Fix bugs in 'val and 'pos with range types 2020-05-26 14:11:08 -06:00
arr_arr
arr_enum_idx_w_gap
array_bounds
array_char_idx
array_of_variable_length
array_ptr_renaming
array_return
array_subscript_addr
arraydim
arrayidx
arrayparam
arrayptr
assign_arr
atomic_enum
attr_ref_and_charlit
bad-task-bp-keyword
bias
big_packed_array
bp_c_mixed_case
bp_enum_homonym
bp_fun_addr
bp_inlined_func
bp_on_var
bp_range_type
bp_reset
byte_packed_arr
call_pn
catch_assert_if
catch_ex Use read_memory in ada_exception_message_1 2020-07-08 07:16:59 -06:00
catch_ex_std
char_enum
char_param
complete
cond_lang
convvar_comp
dgopt
disc_arr_bound
display_nested
dot_all
dyn_arrayidx
dyn_loc
dyn_stride
enum_idx_packed
excep_handle
exec_changed
expr_delims
expr_with_funcall
exprs
fin_fun_out
fixed_cmp
fixed_points
float_param
formatted_ref
frame_arg_lang
frame_args
fullname_bp
fun_addr
fun_in_declare
fun_overload_menu
fun_renaming
funcall_char
funcall_param
funcall_ptr
funcall_ref
homonym
info_addr_mixed_case
info_auto_lang
info_exc
info_locals_renaming
int_deref
interface
iwide
lang_switch
length_cond
maint_with_ada
mi_catch_assert
mi_catch_ex
mi_catch_ex_hand
mi_dyn_arr
mi_ex_cond
mi_exc_info
mi_interface
mi_prot Fix crash in -stack-list-arguments 2020-07-22 12:28:33 -06:00
mi_ref_changeable
mi_string_access
mi_task_arg
mi_task_info
mi_var_access Do not auto-dereference null pointers in Ada MI varobj 2020-09-02 11:30:51 -06:00
mi_var_array
mi_var_union
mi_variant Add tests for Ada changes 2020-04-24 13:40:33 -06:00
minsyms
mod_from_name
n_arr_bound
nested
notcplusplus
null_array
null_record
O2_float_param
operator_bp
optim_drec
out_of_line_in_inlined
packed_array
packed_array_assign
packed_tagged
pckd_arr_ren
pckd_neg
pkd_arr_elem
pp-rec-component
print_chars
ptr_typedef
ptype_array
ptype_field
ptype_tagged_param
py_range
py_taft
rdv_wait
rec_comp
rec_return
ref_param
ref_tick_size
rename_subscript_param
repeat_dyn
same_component_name
same_enum
scalar_storage
scoped_watch
set_pckd_arr_elt
set_wstr
small_reg_param
start
str_binop_equal
str_ref_cmp
str_uninit
sub_variant
sym_print_name
taft_type
tagged
tagged_access
tagged_not_init
task_bp
task_switch_in_core
tasks
tick_last_segv
tick_length_array_enum_idx
type_coercion
unc_arr_ptr_in_var_rec
unchecked_union
uninitialized_vars
var_arr_attrs
var_arr_typedef
var_rec_arr
variant Add support for variable field offsets 2020-04-24 13:40:32 -06:00
variant_record_packed_array
variant-record
varsize_limit
vla
watch_arg
watch_minus_l
whatis_array_val
widewide
win_fu_syms
access_tagged_param.exp Add skip_ada_tests to more Ada testcases 2020-08-13 17:34:21 +01:00
access_to_packed_array.exp Add skip_ada_tests to more Ada testcases 2020-08-13 17:34:21 +01:00
access_to_unbounded_array.exp Add skip_ada_tests to more Ada testcases 2020-08-13 17:34:21 +01:00
addr_arith.exp Add skip_ada_tests to more Ada testcases 2020-08-13 17:34:21 +01:00
aliased_array.exp
arr_acc_idx_w_gap.exp Add skip_ada_tests to more Ada testcases 2020-08-13 17:34:21 +01:00
arr_arr.exp Add skip_ada_tests to more Ada testcases 2020-08-13 17:34:21 +01:00
arr_enum_idx_w_gap.exp Add skip_ada_tests to more Ada testcases 2020-08-13 17:34:21 +01:00
array_bounds.exp Add skip_ada_tests to more Ada testcases 2020-08-13 17:34:21 +01:00
array_char_idx.exp Fix array_char_idx.exp 2020-05-20 07:21:49 -06:00
array_of_variable_length.exp Add skip_ada_tests to more Ada testcases 2020-08-13 17:34:21 +01:00
array_ptr_renaming.exp Add skip_ada_tests to more Ada testcases 2020-08-13 17:34:21 +01:00
array_return.exp
array_subscript_addr.exp Add skip_ada_tests to more Ada testcases 2020-08-13 17:34:21 +01:00
arraydim.exp Add skip_ada_tests to more Ada testcases 2020-08-13 17:34:21 +01:00
arrayidx.exp
arrayparam.exp Add skip_ada_tests to more Ada testcases 2020-08-13 17:34:21 +01:00
arrayptr.exp Add skip_ada_tests to more Ada testcases 2020-08-13 17:34:21 +01:00
assign_1.exp Add skip_ada_tests to more Ada testcases 2020-08-13 17:34:21 +01:00
assign_arr.exp Add skip_ada_tests to more Ada testcases 2020-08-13 17:34:21 +01:00
atomic_enum.exp Add skip_ada_tests to more Ada testcases 2020-08-13 17:34:21 +01:00
attr_ref_and_charlit.exp Add skip_ada_tests to more Ada testcases 2020-08-13 17:34:21 +01:00
bad-task-bp-keyword.exp Add skip_ada_tests to more Ada testcases 2020-08-13 17:34:21 +01:00
bias.exp Add skip_ada_tests to more Ada testcases 2020-08-13 17:34:21 +01:00
big_packed_array.exp
boolean_expr.exp Add skip_ada_tests to more Ada testcases 2020-08-13 17:34:21 +01:00
bp_c_mixed_case.exp Add skip_ada_tests to more Ada testcases 2020-08-13 17:34:21 +01:00
bp_enum_homonym.exp Add skip_ada_tests to more Ada testcases 2020-08-13 17:34:21 +01:00
bp_fun_addr.exp
bp_inlined_func.exp Add skip_ada_tests to more Ada testcases 2020-08-13 17:34:21 +01:00
bp_on_var.exp Add skip_ada_tests to more Ada testcases 2020-08-13 17:34:21 +01:00
bp_range_type.exp Add skip_ada_tests to more Ada testcases 2020-08-13 17:34:21 +01:00
bp_reset.exp Add skip_ada_tests to more Ada testcases 2020-08-13 17:34:21 +01:00
byte_packed_arr.exp
call_pn.exp Add skip_ada_tests to more Ada testcases 2020-08-13 17:34:21 +01:00
catch_assert_if.exp Add skip_ada_tests to more Ada testcases 2020-08-13 17:34:21 +01:00
catch_ex_std.exp Add skip_ada_tests to more Ada testcases 2020-08-13 17:34:21 +01:00
catch_ex.exp Add skip_ada_tests to more Ada testcases 2020-08-13 17:34:21 +01:00
char_enum.exp Add skip_ada_tests to more Ada testcases 2020-08-13 17:34:21 +01:00
char_param.exp Add skip_ada_tests to more Ada testcases 2020-08-13 17:34:21 +01:00
complete.exp Add skip_ada_tests to more Ada testcases 2020-08-13 17:34:21 +01:00
cond_lang.exp Add skip_ada_tests to more Ada testcases 2020-08-13 17:34:21 +01:00
convvar_comp.exp Add skip_ada_tests to more Ada testcases 2020-08-13 17:34:21 +01:00
dgopt.exp Add skip_ada_tests to more Ada testcases 2020-08-13 17:34:21 +01:00
disc_arr_bound.exp Add skip_ada_tests to more Ada testcases 2020-08-13 17:34:21 +01:00
display_nested.exp Add skip_ada_tests to more Ada testcases 2020-08-13 17:34:21 +01:00
dot_all.exp Add skip_ada_tests to more Ada testcases 2020-08-13 17:34:21 +01:00
dyn_arrayidx.exp
dyn_loc.exp Add skip_ada_tests to more Ada testcases 2020-08-13 17:34:21 +01:00
dyn_stride.exp Add skip_ada_tests to more Ada testcases 2020-08-13 17:34:21 +01:00
enum_idx_packed.exp
excep_handle.exp Add skip_ada_tests to more Ada testcases 2020-08-13 17:34:21 +01:00
exec_changed.exp
expr_delims.exp Add skip_ada_tests to more Ada testcases 2020-08-13 17:34:21 +01:00
expr_with_funcall.exp Add skip_ada_tests to more Ada testcases 2020-08-13 17:34:21 +01:00
exprs.exp Add skip_ada_tests to more Ada testcases 2020-08-13 17:34:21 +01:00
fin_fun_out.exp Add skip_ada_tests to more Ada testcases 2020-08-13 17:34:21 +01:00
fixed_cmp.exp Add skip_ada_tests to more Ada testcases 2020-08-13 17:34:21 +01:00
fixed_points.exp
float_param.exp
formatted_ref.exp Add skip_ada_tests to more Ada testcases 2020-08-13 17:34:21 +01:00
frame_arg_lang.exp Add skip_ada_tests to more Ada testcases 2020-08-13 17:34:21 +01:00
frame_args.exp Add skip_ada_tests to more Ada testcases 2020-08-13 17:34:21 +01:00
fullname_bp.exp Add skip_ada_tests to more Ada testcases 2020-08-13 17:34:21 +01:00
fun_addr.exp Add skip_ada_tests to more Ada testcases 2020-08-13 17:34:21 +01:00
fun_in_declare.exp Add skip_ada_tests to more Ada testcases 2020-08-13 17:34:21 +01:00
fun_overload_menu.exp Add skip_ada_tests to more Ada testcases 2020-08-13 17:34:21 +01:00
fun_renaming.exp Add skip_ada_tests to more Ada testcases 2020-08-13 17:34:21 +01:00
funcall_char.exp Add skip_ada_tests to more Ada testcases 2020-08-13 17:34:21 +01:00
funcall_param.exp Add skip_ada_tests to more Ada testcases 2020-08-13 17:34:21 +01:00
funcall_ptr.exp Add skip_ada_tests to more Ada testcases 2020-08-13 17:34:21 +01:00
funcall_ref.exp Add skip_ada_tests to more Ada testcases 2020-08-13 17:34:21 +01:00
homonym.exp Add skip_ada_tests to more Ada testcases 2020-08-13 17:34:21 +01:00
info_addr_mixed_case.exp Add skip_ada_tests to more Ada testcases 2020-08-13 17:34:21 +01:00
info_auto_lang.exp Add skip_ada_tests to more Ada testcases 2020-08-13 17:34:21 +01:00
info_exc.exp Add skip_ada_tests to more Ada testcases 2020-08-13 17:34:21 +01:00
info_locals_renaming.exp
info_types.c
info_types.exp Add skip_ada_tests to more Ada testcases 2020-08-13 17:34:21 +01:00
int_deref.exp Add skip_ada_tests to more Ada testcases 2020-08-13 17:34:21 +01:00
interface.exp Add skip_ada_tests to more Ada testcases 2020-08-13 17:34:21 +01:00
iwide.exp Add skip_ada_tests to more Ada testcases 2020-08-13 17:34:21 +01:00
lang_switch.exp Add skip_ada_tests to more Ada testcases 2020-08-13 17:34:21 +01:00
length_cond.exp Add skip_ada_tests to more Ada testcases 2020-08-13 17:34:21 +01:00
maint_with_ada.exp Add skip_ada_tests to more Ada testcases 2020-08-13 17:34:21 +01:00
mi_catch_assert.exp Add skip_ada_tests to more Ada testcases 2020-08-13 17:34:21 +01:00
mi_catch_ex_hand.exp Add skip_ada_tests to more Ada testcases 2020-08-13 17:34:21 +01:00
mi_catch_ex.exp Add skip_ada_tests to more Ada testcases 2020-08-13 17:34:21 +01:00
mi_dyn_arr.exp Add skip_ada_tests to more Ada testcases 2020-08-13 17:34:21 +01:00
mi_ex_cond.exp Add skip_ada_tests to more Ada testcases 2020-08-13 17:34:21 +01:00
mi_exc_info.exp Add skip_ada_tests to more Ada testcases 2020-08-13 17:34:21 +01:00
mi_interface.exp Add skip_ada_tests to more Ada testcases 2020-08-13 17:34:21 +01:00
mi_prot.exp Add skip_ada_tests to more Ada testcases 2020-08-13 17:34:21 +01:00
mi_ref_changeable.exp Add skip_ada_tests to more Ada testcases 2020-08-13 17:34:21 +01:00
mi_string_access.exp Add skip_ada_tests to more Ada testcases 2020-08-13 17:34:21 +01:00
mi_task_arg.exp Add skip_ada_tests to more Ada testcases 2020-08-13 17:34:21 +01:00
mi_task_info.exp Add skip_ada_tests to more Ada testcases 2020-08-13 17:34:21 +01:00
mi_var_access.exp Do not auto-dereference null pointers in Ada MI varobj 2020-09-02 11:30:51 -06:00
mi_var_array.exp Do not auto-dereference null pointers in Ada MI varobj 2020-09-02 11:30:51 -06:00
mi_var_union.exp Add skip_ada_tests to more Ada testcases 2020-08-13 17:34:21 +01:00
mi_variant.exp Add skip_ada_tests to more Ada testcases 2020-08-13 17:34:21 +01:00
minsyms.exp Add skip_ada_tests to more Ada testcases 2020-08-13 17:34:21 +01:00
mod_from_name.exp Add skip_ada_tests to more Ada testcases 2020-08-13 17:34:21 +01:00
n_arr_bound.exp
nested.exp Add skip_ada_tests to more Ada testcases 2020-08-13 17:34:21 +01:00
notcplusplus.exp
null_array.exp Add skip_ada_tests to more Ada testcases 2020-08-13 17:34:21 +01:00
null_record.exp
O2_float_param.exp
operator_bp.exp [gdb/testsuite] Fix gdb.ada/operator_bp.exp breakpoint location FAILs 2020-05-01 17:57:56 +02:00
optim_drec.exp Add skip_ada_tests to more Ada testcases 2020-08-13 17:34:21 +01:00
out_of_line_in_inlined.exp Add skip_ada_tests to more Ada testcases 2020-08-13 17:34:21 +01:00
packed_array_assign.exp Add skip_ada_tests to more Ada testcases 2020-08-13 17:34:21 +01:00
packed_array.exp
packed_tagged.exp Add skip_ada_tests to more Ada testcases 2020-08-13 17:34:21 +01:00
pckd_arr_ren.exp
pckd_neg.exp
pkd_arr_elem.exp
pp-rec-component.exp Add skip_ada_tests to more Ada testcases 2020-08-13 17:34:21 +01:00
pp-rec-component.py
print_chars.exp Add skip_ada_tests to more Ada testcases 2020-08-13 17:34:21 +01:00
print_pc.exp Add skip_ada_tests to more Ada testcases 2020-08-13 17:34:21 +01:00
ptr_typedef.exp Add skip_ada_tests to more Ada testcases 2020-08-13 17:34:21 +01:00
ptype_arith_binop.exp Add skip_ada_tests to more Ada testcases 2020-08-13 17:34:21 +01:00
ptype_array.exp Add skip_ada_tests to more Ada testcases 2020-08-13 17:34:21 +01:00
ptype_field.exp Add skip_ada_tests to more Ada testcases 2020-08-13 17:34:21 +01:00
ptype_tagged_param.exp Add skip_ada_tests to more Ada testcases 2020-08-13 17:34:21 +01:00
ptype_union.c
ptype_union.exp Add skip_ada_tests to more Ada testcases 2020-08-13 17:34:21 +01:00
py_range.exp Add skip_ada_tests to more Ada testcases 2020-08-13 17:34:21 +01:00
py_taft.exp Add skip_ada_tests to more Ada testcases 2020-08-13 17:34:21 +01:00
rdv_wait.exp Add skip_ada_tests to more Ada testcases 2020-08-13 17:34:21 +01:00
rec_comp.exp Add skip_ada_tests to more Ada testcases 2020-08-13 17:34:21 +01:00
rec_return.exp Add skip_ada_tests to more Ada testcases 2020-08-13 17:34:21 +01:00
ref_param.exp Add skip_ada_tests to more Ada testcases 2020-08-13 17:34:21 +01:00
ref_tick_size.exp Add skip_ada_tests to more Ada testcases 2020-08-13 17:34:21 +01:00
rename_subscript_param.exp Add skip_ada_tests to more Ada testcases 2020-08-13 17:34:21 +01:00
repeat_dyn.exp Add skip_ada_tests to more Ada testcases 2020-08-13 17:34:21 +01:00
same_component_name.exp Add skip_ada_tests to more Ada testcases 2020-08-13 17:34:21 +01:00
same_enum.exp Add skip_ada_tests to more Ada testcases 2020-08-13 17:34:21 +01:00
scalar_storage.exp Add skip_ada_tests to more Ada testcases 2020-08-13 17:34:21 +01:00
scoped_watch.exp
set_pckd_arr_elt.exp
set_wstr.exp Add skip_ada_tests to more Ada testcases 2020-08-13 17:34:21 +01:00
small_reg_param.exp Add skip_ada_tests to more Ada testcases 2020-08-13 17:34:21 +01:00
start.exp
str_binop_equal.exp Add skip_ada_tests to more Ada testcases 2020-08-13 17:34:21 +01:00
str_ref_cmp.exp Add skip_ada_tests to more Ada testcases 2020-08-13 17:34:21 +01:00
str_uninit.exp Add skip_ada_tests to more Ada testcases 2020-08-13 17:34:21 +01:00
sub_variant.exp Add skip_ada_tests to more Ada testcases 2020-08-13 17:34:21 +01:00
sym_print_name.exp Add skip_ada_tests to more Ada testcases 2020-08-13 17:34:21 +01:00
taft_type.exp Add skip_ada_tests to more Ada testcases 2020-08-13 17:34:21 +01:00
tagged_access.exp Add skip_ada_tests to more Ada testcases 2020-08-13 17:34:21 +01:00
tagged_not_init.exp
tagged.exp Add skip_ada_tests to more Ada testcases 2020-08-13 17:34:21 +01:00
task_bp.exp Add skip_ada_tests to more Ada testcases 2020-08-13 17:34:21 +01:00
task_switch_in_core.exp Add skip_ada_tests to more Ada testcases 2020-08-13 17:34:21 +01:00
tasks.exp Add skip_ada_tests to more Ada testcases 2020-08-13 17:34:21 +01:00
tick_last_segv.exp Add skip_ada_tests to more Ada testcases 2020-08-13 17:34:21 +01:00
tick_length_array_enum_idx.exp Add skip_ada_tests to more Ada testcases 2020-08-13 17:34:21 +01:00
type_coercion.exp Add skip_ada_tests to more Ada testcases 2020-08-13 17:34:21 +01:00
unc_arr_ptr_in_var_rec.exp Add skip_ada_tests to more Ada testcases 2020-08-13 17:34:21 +01:00
unchecked_union.exp Add skip_ada_tests to more Ada testcases 2020-08-13 17:34:21 +01:00
uninitialized_vars.exp Add skip_ada_tests to more Ada testcases 2020-08-13 17:34:21 +01:00
var_arr_attrs.exp Add skip_ada_tests to more Ada testcases 2020-08-13 17:34:21 +01:00
var_arr_typedef.exp Add skip_ada_tests to more Ada testcases 2020-08-13 17:34:21 +01:00
var_rec_arr.exp Add skip_ada_tests to more Ada testcases 2020-08-13 17:34:21 +01:00
variant_record_packed_array.exp Add skip_ada_tests to more Ada testcases 2020-08-13 17:34:21 +01:00
variant-record.exp Add skip_ada_tests to more Ada testcases 2020-08-13 17:34:21 +01:00
variant.exp Add skip_ada_tests to more Ada testcases 2020-08-13 17:34:21 +01:00
varsize_limit.exp Add skip_ada_tests to more Ada testcases 2020-08-13 17:34:21 +01:00
vla.exp
watch_arg.exp
watch_minus_l.exp
whatis_array_val.exp Add skip_ada_tests to more Ada testcases 2020-08-13 17:34:21 +01:00
widewide.exp Add skip_ada_tests to more Ada testcases 2020-08-13 17:34:21 +01:00
win_fu_syms.exp Add skip_ada_tests to more Ada testcases 2020-08-13 17:34:21 +01:00