This is the mail archive of the
gdb-cvs@sourceware.org
mailing list for the GDB project.
src/gdb ChangeLog ada-valprint.c testsuite/Cha ...
- From: brobecke at sourceware dot org
- To: gdb-cvs at sourceware dot org
- Date: 29 Dec 2010 08:02:59 -0000
- Subject: src/gdb ChangeLog ada-valprint.c testsuite/Cha ...
CVSROOT: /cvs/src
Module name: src
Changes by: brobecke@sourceware.org 2010-12-29 08:02:59
Modified files:
gdb : ChangeLog ada-valprint.c
gdb/testsuite : ChangeLog
gdb/testsuite/gdb.ada: arrayptr.exp
gdb/testsuite/gdb.ada/arrayptr: foo.adb
Log message:
[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.
Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gdb/ChangeLog.diff?cvsroot=src&r1=1.12413&r2=1.12414
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gdb/ada-valprint.c.diff?cvsroot=src&r1=1.68&r2=1.69
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gdb/testsuite/ChangeLog.diff?cvsroot=src&r1=1.2534&r2=1.2535
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gdb/testsuite/gdb.ada/arrayptr.exp.diff?cvsroot=src&r1=1.4&r2=1.5
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gdb/testsuite/gdb.ada/arrayptr/foo.adb.diff?cvsroot=src&r1=1.3&r2=1.4