aboutsummaryrefslogtreecommitdiff
path: root/gdb/ada-lang.c
diff options
context:
space:
mode:
authorJoel Brobecker <brobecker@gnat.com>2008-01-02 11:18:03 +0000
committerJoel Brobecker <brobecker@gnat.com>2008-01-02 11:18:03 +0000
commitf58b38bf6a319bb88f01acfafe5f5e6eb614f79b (patch)
tree401394a32dcb3a3e1a6ea0f2f915b615229bd0c7 /gdb/ada-lang.c
parent3fe15143a898e68b8468e42bb838a689071eba0b (diff)
downloadgdb-f58b38bf6a319bb88f01acfafe5f5e6eb614f79b.zip
gdb-f58b38bf6a319bb88f01acfafe5f5e6eb614f79b.tar.gz
gdb-f58b38bf6a319bb88f01acfafe5f5e6eb614f79b.tar.bz2
* ada-lang.c (ada_value_equal): Dereference reference types when
comparing arrays.
Diffstat (limited to 'gdb/ada-lang.c')
-rw-r--r--gdb/ada-lang.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/gdb/ada-lang.c b/gdb/ada-lang.c
index 58a2f57..b3090a3 100644
--- a/gdb/ada-lang.c
+++ b/gdb/ada-lang.c
@@ -7744,6 +7744,11 @@ ada_value_equal (struct value *arg1, struct value *arg2)
if (ada_is_direct_array_type (value_type (arg1))
|| ada_is_direct_array_type (value_type (arg2)))
{
+ /* Automatically dereference any array reference before
+ we attempt to perform the comparison. */
+ arg1 = ada_coerce_ref (arg1);
+ arg2 = ada_coerce_ref (arg2);
+
arg1 = ada_coerce_to_simple_array (arg1);
arg2 = ada_coerce_to_simple_array (arg2);
if (TYPE_CODE (value_type (arg1)) != TYPE_CODE_ARRAY