From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 24390 invoked by alias); 2 May 2010 16:56:03 -0000 Received: (qmail 24367 invoked by uid 22791); 2 May 2010 16:56:02 -0000 X-SWARE-Spam-Status: No, hits=-1.9 required=5.0 tests=BAYES_00 X-Spam-Check-By: sourceware.org Received: from rock.gnat.com (HELO rock.gnat.com) (205.232.38.15) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Sun, 02 May 2010 16:55:56 +0000 Received: from localhost (localhost.localdomain [127.0.0.1]) by filtered-rock.gnat.com (Postfix) with ESMTP id 299152BAB66; Sun, 2 May 2010 12:55:55 -0400 (EDT) Received: from rock.gnat.com ([127.0.0.1]) by localhost (rock.gnat.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 9b2oLo18VevF; Sun, 2 May 2010 12:55:55 -0400 (EDT) Received: from joel.gnat.com (localhost.localdomain [127.0.0.1]) by rock.gnat.com (Postfix) with ESMTP id D8AE72BAB5B; Sun, 2 May 2010 12:55:54 -0400 (EDT) Received: by joel.gnat.com (Postfix, from userid 1000) id 73788F58F9; Sun, 2 May 2010 09:55:47 -0700 (PDT) Date: Sun, 02 May 2010 16:56:00 -0000 From: Joel Brobecker To: Mark Kettenis Cc: gdb-patches@sourceware.org Subject: Re: [RFA/sparc] "finish" does not work if function returns array. Message-ID: <20100502165547.GD2768@adacore.com> References: <1272666620-10914-1-git-send-email-brobecker@adacore.com> <201005010901.o4191RM8014188@glazunov.sibelius.xs4all.nl> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="M9NhX3UHpAaciwkO" Content-Disposition: inline In-Reply-To: <201005010901.o4191RM8014188@glazunov.sibelius.xs4all.nl> User-Agent: Mutt/1.5.20 (2009-06-14) Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2010-05/txt/msg00017.txt.bz2 --M9NhX3UHpAaciwkO Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-length: 436 > > -/* 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 --M9NhX3UHpAaciwkO Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="arrays-returns-on-sparc.diff" Content-length: 1895 commit c39300fabadf2ee77ab98accdff7aa6c7df463f0 Author: Joel Brobecker Date: Fri Apr 30 15:19:16 2010 -0700 "finish" does not work on sparc if function returns array. 2010-04-30 Joel Brobecker * 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; --M9NhX3UHpAaciwkO--