This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [RFA/sparc] "finish" does not work if function returns array.
- From: Joel Brobecker <brobecker at adacore dot com>
- To: Mark Kettenis <mark dot kettenis at xs4all dot nl>
- Cc: gdb-patches at sourceware dot org
- Date: Sun, 2 May 2010 09:55:47 -0700
- Subject: Re: [RFA/sparc] "finish" does not work if function returns array.
- References: <1272666620-10914-1-git-send-email-brobecker@adacore.com> <201005010901.o4191RM8014188@glazunov.sibelius.xs4all.nl>
> > -/* Check whether TYPE is "Structure or Union". */
> > +/* Check whether TYPE is "Structure or Union".
> > +
> > + In terms of subprogram calls, arrays are treated the same as struct
> > + and union types. So this function also returns non-zero for array
> > + types. */
>
> Could you turn that into "In terms of Ada subprogram calls..."?
Sure! Thanks for the quick review.
Here is a new version of the patch.
--
Joel
commit c39300fabadf2ee77ab98accdff7aa6c7df463f0
Author: Joel Brobecker <brobecker@adacore.com>
Date: Fri Apr 30 15:19:16 2010 -0700
"finish" does not work on sparc if function returns array.
2010-04-30 Joel Brobecker <brobecker@adacore.com>
* sparc-tdep.c (sparc_structure_or_union_p): Return non-zero
for array types.
* sparc64-tdep.c (sparc64_structure_or_union_p): Likewise.
diff --git a/gdb/sparc-tdep.c b/gdb/sparc-tdep.c
index a2bae9f..29a12cf 100644
--- a/gdb/sparc-tdep.c
+++ b/gdb/sparc-tdep.c
@@ -221,7 +221,11 @@ sparc_floating_p (const struct type *type)
return 0;
}
-/* Check whether TYPE is "Structure or Union". */
+/* Check whether TYPE is "Structure or Union".
+
+ In terms of Ada subprogram calls, arrays are treated the same as
+ struct and union types. So this function also returns non-zero
+ for array types. */
static int
sparc_structure_or_union_p (const struct type *type)
@@ -230,6 +234,7 @@ sparc_structure_or_union_p (const struct type *type)
{
case TYPE_CODE_STRUCT:
case TYPE_CODE_UNION:
+ case TYPE_CODE_ARRAY:
return 1;
default:
break;
diff --git a/gdb/sparc64-tdep.c b/gdb/sparc64-tdep.c
index 9a34834..3cd6109 100644
--- a/gdb/sparc64-tdep.c
+++ b/gdb/sparc64-tdep.c
@@ -103,7 +103,11 @@ sparc64_floating_p (const struct type *type)
return 0;
}
-/* Check whether TYPE is "Structure or Union". */
+/* Check whether TYPE is "Structure or Union".
+
+ In terms of Ada subprogram calls, arrays are treated the same as
+ struct and union types. So this function also returns non-zero
+ for array types. */
static int
sparc64_structure_or_union_p (const struct type *type)
@@ -112,6 +116,7 @@ sparc64_structure_or_union_p (const struct type *type)
{
case TYPE_CODE_STRUCT:
case TYPE_CODE_UNION:
+ case TYPE_CODE_ARRAY:
return 1;
default:
break;