Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Joel Brobecker <brobecker@adacore.com>
To: Mark Kettenis <mark.kettenis@xs4all.nl>
Cc: gdb-patches@sourceware.org
Subject: Re: [RFA/sparc] "finish" does not work if function returns array.
Date: Sun, 02 May 2010 16:56:00 -0000	[thread overview]
Message-ID: <20100502165547.GD2768@adacore.com> (raw)
In-Reply-To: <201005010901.o4191RM8014188@glazunov.sibelius.xs4all.nl>

[-- Attachment #1: Type: text/plain, Size: 436 bytes --]

> > -/* 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

[-- Attachment #2: arrays-returns-on-sparc.diff --]
[-- Type: text/x-diff, Size: 1895 bytes --]

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;

  reply	other threads:[~2010-05-02 16:56 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-04-30 22:30 Joel Brobecker
2010-05-01  9:02 ` Mark Kettenis
2010-05-02 16:56   ` Joel Brobecker [this message]
2010-05-05 17:00     ` Joel Brobecker

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20100502165547.GD2768@adacore.com \
    --to=brobecker@adacore.com \
    --cc=gdb-patches@sourceware.org \
    --cc=mark.kettenis@xs4all.nl \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox