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 Update copyright year in most headers. 2010-01-01 07:32:07 +00:00
array_return Update copyright year in most headers. 2010-01-01 07:32:07 +00:00
array_subscript_addr Update copyright year in most headers. 2010-01-01 07:32:07 +00:00
arrayidx Update copyright year in most headers. 2010-01-01 07:32:07 +00:00
arrayparam Update copyright year in most headers. 2010-01-01 07:32:07 +00:00
arrayptr [Ada] print null array pointer as 0x0' rather than (null)' 2010-12-29 08:02:59 +00:00
atomic_enum Update copyright year in most headers. 2010-01-01 07:32:07 +00:00
call_pn amd64: Integer parameters in function calls on Windows. 2010-01-29 05:19:23 +00:00
catch_ex Update copyright year in most headers. 2010-01-01 07:32:07 +00:00
char_param Update copyright year in most headers. 2010-01-01 07:32:07 +00:00
complete * gdb.ada/complete/pck.ads, gdb.ada/complete/pck.adb, 2008-02-05 22:20:51 +00:00
cond_lang Use breakpoint location to parse condition over current language. 2010-05-17 17:23:33 +00:00
dyn_loc Wrong value printed by info locals for dynamic object. 2010-04-20 22:26:57 +00:00
exec_changed Update copyright year in most headers. 2010-01-01 07:32:07 +00:00
exprs Update copyright year in most headers. 2010-01-01 07:32:07 +00:00
fixed_cmp Update copyright year in most headers. 2010-01-01 07:32:07 +00:00
fixed_points Update copyright year in most headers. 2010-01-01 07:32:07 +00:00
formatted_ref Update copyright year in most headers. 2010-01-01 07:32:07 +00:00
frame_args Update copyright year in most headers. 2010-01-01 07:32:07 +00:00
fun_addr Update copyright year in most headers. 2010-01-01 07:32:07 +00:00
fun_in_declare Update copyright year in most headers. 2010-01-01 07:32:07 +00:00
funcall_param Update copyright year in most headers. 2010-01-01 07:32:07 +00:00
homonym Update copyright year in most headers. 2010-01-01 07:32:07 +00:00
int_deref Update copyright year in most headers. 2010-01-01 07:32:07 +00:00
interface Update copyright year in most headers. 2010-01-01 07:32:07 +00:00
lang_switch Update copyright year in most headers. 2010-01-01 07:32:07 +00:00
mod_from_name Update copyright year in most headers. 2010-01-01 07:32:07 +00:00
nested Update copyright year in most headers. 2010-01-01 07:32:07 +00:00
null_array Update copyright year in most headers. 2010-01-01 07:32:07 +00:00
null_record Update copyright year in most headers. 2010-01-01 07:32:07 +00:00
packed_array Update copyright year in most headers. 2010-01-01 07:32:07 +00:00
packed_tagged Update copyright year in most headers. 2010-01-01 07:32:07 +00:00
print_chars Update copyright year in most headers. 2010-01-01 07:32:07 +00:00
ptype_field Update copyright year in most headers. 2010-01-01 07:32:07 +00:00
ptype_tagged_param * gdb.ada/ptype_tagged_param: New testcase. 2010-02-09 13:16:33 +00:00
rec_return amd64 - function returning record with field straddling 2 registers 2010-01-29 14:39:04 +00:00
ref_param Update copyright year in most headers. 2010-01-01 07:32:07 +00:00
ref_tick_size Update copyright year in most headers. 2010-01-01 07:32:07 +00:00
start Update copyright year in most headers. 2010-01-01 07:32:07 +00:00
str_ref_cmp Update copyright year in most headers. 2010-01-01 07:32:07 +00:00
sym_print_name Update copyright year in most headers. 2010-01-01 07:32:07 +00:00
taft_type Update copyright year in most headers. 2010-01-01 07:32:07 +00:00
tagged Update copyright year in most headers. 2010-01-01 07:32:07 +00:00
tasks Update copyright year in most headers. 2010-01-01 07:32:07 +00:00
tick_last_segv Update copyright year in most headers. 2010-01-01 07:32:07 +00:00
type_coercion Update copyright year in most headers. 2010-01-01 07:32:07 +00:00
uninitialized_vars * gdb.ada/uninitialized_vars: New test program. 2009-02-04 18:09:38 +00:00
variant_record_packed_array Update copyright year in most headers. 2010-01-01 07:32:07 +00:00
watch_arg make parameter being watched is a non-constant. 2010-05-17 21:32:57 +00:00
array_bounds.exp Update copyright year in most headers. 2010-01-01 07:32:07 +00:00
array_return.exp Update copyright year in most headers. 2010-01-01 07:32:07 +00:00
array_subscript_addr.exp Update copyright year in most headers. 2010-01-01 07:32:07 +00:00
arrayidx.exp lib/gdb.exp: New gdb_test_no_output function. 2010-05-20 19:18:58 +00:00
arrayparam.exp Update copyright year in most headers. 2010-01-01 07:32:07 +00:00
arrayptr.exp [Ada] print null array pointer as 0x0' rather than (null)' 2010-12-29 08:02:59 +00:00
assign_1.exp 2010-06-08 Michael Snyder <msnyder@vmware.com> 2010-06-10 19:48:20 +00:00
atomic_enum.exp Update copyright year in most headers. 2010-01-01 07:32:07 +00:00
boolean_expr.exp 2010-06-08 Michael Snyder <msnyder@vmware.com> 2010-06-10 19:48:20 +00:00
call_pn.exp amd64: Integer parameters in function calls on Windows. 2010-01-29 05:19:23 +00:00
catch_ex.exp Update copyright year in most headers. 2010-01-01 07:32:07 +00:00
char_param.exp Update copyright year in most headers. 2010-01-01 07:32:07 +00:00
complete.exp Update copyright year in most headers. 2010-01-01 07:32:07 +00:00
cond_lang.exp Use breakpoint location to parse condition over current language. 2010-05-17 17:23:33 +00:00
dyn_loc.exp Wrong value printed by info locals for dynamic object. 2010-04-20 22:26:57 +00:00
exec_changed.exp 2010-06-08 Michael Snyder <msnyder@vmware.com> 2010-06-08 22:58:03 +00:00
exprs.exp Update copyright year in most headers. 2010-01-01 07:32:07 +00:00
fixed_cmp.exp Update copyright year in most headers. 2010-01-01 07:32:07 +00:00
fixed_points.exp Update copyright year in most headers. 2010-01-01 07:32:07 +00:00
formatted_ref.exp 2010-05-25 Michael Snyder <msnyder@vmware.com> 2010-05-26 18:05:25 +00:00
frame_args.exp 2010-06-08 Michael Snyder <msnyder@vmware.com> 2010-06-10 19:48:20 +00:00
fun_addr.exp Update copyright year in most headers. 2010-01-01 07:32:07 +00:00
fun_in_declare.exp Update copyright year in most headers. 2010-01-01 07:32:07 +00:00
funcall_param.exp Update copyright year in most headers. 2010-01-01 07:32:07 +00:00
gnat_ada.gpr Update copyright year in most headers. 2010-01-01 07:32:07 +00:00
homonym.exp Update copyright year in most headers. 2010-01-01 07:32:07 +00:00
info_types.c "unsupported language" error in info types when using Ada. 2010-04-20 22:38:02 +00:00
info_types.exp "unsupported language" error in info types when using Ada. 2010-04-20 22:38:02 +00:00
int_deref.exp Update copyright year in most headers. 2010-01-01 07:32:07 +00:00
interface.exp Update copyright year in most headers. 2010-01-01 07:32:07 +00:00
lang_switch.exp [Ada] do not print arrays as array pointers 2010-12-29 08:01:32 +00:00
Makefile.in * gdb.ada/Makefile.in (EXECUTABLES): Bring up to date. 2008-09-10 17:24:06 +00:00
mod_from_name.exp Update copyright year in most headers. 2010-01-01 07:32:07 +00:00
nested.exp Update copyright year in most headers. 2010-01-01 07:32:07 +00:00
null_array.exp gdb/testsuite/ 2010-11-04 18:52:11 +00:00
null_record.exp Update copyright year in most headers. 2010-01-01 07:32:07 +00:00
packed_array.exp Update copyright year in most headers. 2010-01-01 07:32:07 +00:00
packed_tagged.exp Update copyright year in most headers. 2010-01-01 07:32:07 +00:00
print_chars.exp Update copyright year in most headers. 2010-01-01 07:32:07 +00:00
print_pc.exp Update copyright year in most headers. 2010-01-01 07:32:07 +00:00
ptype_arith_binop.exp 2010-06-08 Michael Snyder <msnyder@vmware.com> 2010-06-10 19:48:20 +00:00
ptype_field.exp Update copyright year in most headers. 2010-01-01 07:32:07 +00:00
ptype_tagged_param.exp * gdb.ada/ptype_tagged_param: New testcase. 2010-02-09 13:16:33 +00:00
rec_return.exp amd64 - function returning record with field straddling 2 registers 2010-01-29 14:39:04 +00:00
ref_param.exp 2010-06-08 Michael Snyder <msnyder@vmware.com> 2010-06-10 19:48:20 +00:00
ref_tick_size.exp Update copyright year in most headers. 2010-01-01 07:32:07 +00:00
start.exp Update copyright year in most headers. 2010-01-01 07:32:07 +00:00
str_ref_cmp.exp Update copyright year in most headers. 2010-01-01 07:32:07 +00:00
sym_print_name.exp Update copyright year in most headers. 2010-01-01 07:32:07 +00:00
taft_type.exp Update copyright year in most headers. 2010-01-01 07:32:07 +00:00
tagged.exp Update copyright year in most headers. 2010-01-01 07:32:07 +00:00
tasks.exp Update copyright year in most headers. 2010-01-01 07:32:07 +00:00
tick_last_segv.exp Update copyright year in most headers. 2010-01-01 07:32:07 +00:00
type_coercion.exp 2010-06-08 Michael Snyder <msnyder@vmware.com> 2010-06-10 19:48:20 +00:00
uninitialized_vars.exp Update copyright year in most headers. 2010-01-01 07:32:07 +00:00
variant_record_packed_array.exp Update copyright year in most headers. 2010-01-01 07:32:07 +00:00
watch_arg.exp Update copyright year in most headers. 2010-01-01 07:32:07 +00:00