old-cross-binutils/gdb/testsuite/gdb.ada
Joel Brobecker 9e87a40907 [Ada] print null array pointer as 0x0' rather than (null)'
Trying to print a variable defined as an access to an unconstrained
array:

       type String_Access is access String;
       S1 : String_Access;

If that variable is null, then GDB prints its value in an odd way:

    (gdb) print S1
    $1 = (string_bug.string_access) (null)
                                    ^^^^^^

This patch changes the debugger behavior to print the pointer using
the same output we'd use for any null pointer:

    (gdb) print S1
    $1 = (string_bug.string_access) 0x0

It also adds an assert, helping us verify an assumption.

gdb/ChangeLog:

        * ada-valprint.c (ada_val_print_1): Print null array pointers as
        `0x0' rather than `(null)'.  Add assertion.

gdb/testsuite/ChangeLog:

        * gdb.ada/arrayptr/foo.adb: Add new local variable Null_String.
        * gdb.ada/arrayptr.exp: Add test printing that new variable.
2010-12-29 08:02:59 +00:00
..
array_bounds
array_return
array_subscript_addr
arrayidx
arrayparam
arrayptr [Ada] print null array pointer as 0x0' rather than (null)' 2010-12-29 08:02:59 +00:00
atomic_enum
call_pn
catch_ex
char_param
complete
cond_lang
dyn_loc
exec_changed
exprs
fixed_cmp
fixed_points
formatted_ref
frame_args
fun_addr
fun_in_declare
funcall_param
homonym
int_deref
interface
lang_switch
mod_from_name
nested
null_array
null_record
packed_array
packed_tagged
print_chars
ptype_field
ptype_tagged_param
rec_return
ref_param
ref_tick_size
start
str_ref_cmp
sym_print_name
taft_type
tagged
tasks
tick_last_segv
type_coercion
uninitialized_vars
variant_record_packed_array
watch_arg
array_bounds.exp
array_return.exp
array_subscript_addr.exp
arrayidx.exp
arrayparam.exp
arrayptr.exp [Ada] print null array pointer as 0x0' rather than (null)' 2010-12-29 08:02:59 +00:00
assign_1.exp
atomic_enum.exp
boolean_expr.exp
call_pn.exp
catch_ex.exp
char_param.exp
complete.exp
cond_lang.exp
dyn_loc.exp
exec_changed.exp
exprs.exp
fixed_cmp.exp
fixed_points.exp
formatted_ref.exp
frame_args.exp
fun_addr.exp
fun_in_declare.exp
funcall_param.exp
gnat_ada.gpr
homonym.exp
info_types.c
info_types.exp
int_deref.exp
interface.exp
lang_switch.exp
Makefile.in
mod_from_name.exp
nested.exp
null_array.exp
null_record.exp
packed_array.exp
packed_tagged.exp
print_chars.exp
print_pc.exp
ptype_arith_binop.exp
ptype_field.exp
ptype_tagged_param.exp
rec_return.exp
ref_param.exp
ref_tick_size.exp
start.exp
str_ref_cmp.exp
sym_print_name.exp
taft_type.exp
tagged.exp
tasks.exp
tick_last_segv.exp
type_coercion.exp
uninitialized_vars.exp
variant_record_packed_array.exp
watch_arg.exp