aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gdb/ChangeLog5
-rw-r--r--gdb/ada-valprint.c3
-rw-r--r--gdb/testsuite/ChangeLog5
-rw-r--r--gdb/testsuite/gdb.ada/arrayptr.exp1
-rw-r--r--gdb/testsuite/gdb.ada/arrayptr/foo.adb2
5 files changed, 15 insertions, 1 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index e1f238e..7d3e3ce 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,5 +1,10 @@
2010-12-29 Joel Brobecker <brobecker@adacore.com>
+ * ada-valprint.c (ada_val_print_1): Print null array pointers as
+ `0x0' rather than `(null)'. Add assertion.
+
+2010-12-29 Joel Brobecker <brobecker@adacore.com>
+
* ada-lang.h (ada_coerce_to_simple_array): Add declaration.
* ada-lang.c (ada_typedef_target_type): New function.
(desc_base_type): Add handling of fat pointer typedefs.
diff --git a/gdb/ada-valprint.c b/gdb/ada-valprint.c
index b5d4b02..7c74838 100644
--- a/gdb/ada-valprint.c
+++ b/gdb/ada-valprint.c
@@ -690,7 +690,8 @@ ada_val_print_1 (struct type *type, const gdb_byte *valaddr0,
val = ada_coerce_to_simple_array (val);
if (val == NULL)
{
- fprintf_filtered (stream, "(null)");
+ gdb_assert (TYPE_CODE (type) == TYPE_CODE_TYPEDEF);
+ fprintf_filtered (stream, "0x0");
retn = 0;
}
else
diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog
index 5124dbb..4580f60 100644
--- a/gdb/testsuite/ChangeLog
+++ b/gdb/testsuite/ChangeLog
@@ -1,5 +1,10 @@
2010-12-29 Joel Brobecker <brobecker@adacore.com>
+ * gdb.ada/arrayptr/foo.adb: Add new local variable Null_String.
+ * gdb.ada/arrayptr.exp: Add test printing that new variable.
+
+2010-12-29 Joel Brobecker <brobecker@adacore.com>
+
* gdb.ada/lang_switch.exp: Correct expected parameter value.
2010-12-25 Andreas Schwab <schwab@linux-m68k.org>
diff --git a/gdb/testsuite/gdb.ada/arrayptr.exp b/gdb/testsuite/gdb.ada/arrayptr.exp
index 0f450a0..43a04c1 100644
--- a/gdb/testsuite/gdb.ada/arrayptr.exp
+++ b/gdb/testsuite/gdb.ada/arrayptr.exp
@@ -44,3 +44,4 @@ gdb_test "print string_p" \
"= \\(foo\\.string_access\\) 0x\[0-9a-zA-Z\]+" \
"print string_p"
+gdb_test "print null_string" "= \\(foo\\.string_access\\) 0x0"
diff --git a/gdb/testsuite/gdb.ada/arrayptr/foo.adb b/gdb/testsuite/gdb.ada/arrayptr/foo.adb
index 8cedd87..c11ccfb 100644
--- a/gdb/testsuite/gdb.ada/arrayptr/foo.adb
+++ b/gdb/testsuite/gdb.ada/arrayptr/foo.adb
@@ -19,6 +19,8 @@ procedure Foo is
type String_Access is access String;
String_P : String_Access := new String'("Hello");
+ Null_String : String_Access := null;
begin
Do_Nothing (String_P'Address); -- STOP
+ Do_Nothing (Null_String'Address);
end Foo;