From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 29291 invoked by alias); 24 Dec 2006 09:35:39 -0000 Received: (qmail 29283 invoked by uid 22791); 24 Dec 2006 09:35:38 -0000 X-Spam-Check-By: sourceware.org Received: from nile.gnat.com (HELO nile.gnat.com) (205.232.38.5) by sourceware.org (qpsmtpd/0.31) with ESMTP; Sun, 24 Dec 2006 09:35:30 +0000 Received: from localhost (localhost [127.0.0.1]) by filtered-nile.gnat.com (Postfix) with ESMTP id E440848CDBF; Sun, 24 Dec 2006 04:35:28 -0500 (EST) Received: from nile.gnat.com ([127.0.0.1]) by localhost (nile.gnat.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 20955-01-3; Sun, 24 Dec 2006 04:35:28 -0500 (EST) Received: from takamaka.act-europe.fr (AStDenis-105-1-57-168.w80-8.abo.wanadoo.fr [80.8.154.168]) by nile.gnat.com (Postfix) with ESMTP id F2EE248CDAE; Sun, 24 Dec 2006 04:35:27 -0500 (EST) Received: by takamaka.act-europe.fr (Postfix, from userid 1000) id 5369B34C099; Sun, 24 Dec 2006 13:36:15 +0400 (RET) Date: Sun, 24 Dec 2006 09:35:00 -0000 From: Joel Brobecker To: mark.kettenis@xs4all.nl Cc: gdb-patches@sourceware.org Subject: [RFA/sparc64] internal-error printing return value (Ada array) - take 2 Message-ID: <20061224093615.GH19684@adacore.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="kXdP64Ggrk/fb43R" Content-Disposition: inline User-Agent: Mutt/1.4.2.2i 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: 2006-12/txt/msg00311.txt.bz2 --kXdP64Ggrk/fb43R Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-length: 490 Hello Mark, Following our disccussion that started at: http://www.sourceware.org/ml/gdb-patches/2006-11/msg00076.html I finally found the time to make the change you suggested, and then test it again. 2006-12-24 Joel Brobecker * sparc64-tdep.c (sparc64_extract_return_value): Add handling for array types. (sparc64_store_return_value): Likewise. Tested on sparc64-sun-solaris2.8, no regression. OK to commit? Thank you, -- Joel --kXdP64Ggrk/fb43R Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="sparc64.diff" Content-length: 1440 Index: sparc64-tdep.c =================================================================== RCS file: /cvs/src/src/gdb/sparc64-tdep.c,v retrieving revision 1.27 diff -u -p -r1.27 sparc64-tdep.c --- sparc64-tdep.c 22 Aug 2006 20:57:56 -0000 1.27 +++ sparc64-tdep.c 24 Dec 2006 08:42:30 -0000 @@ -1086,6 +1086,15 @@ sparc64_extract_return_value (struct typ regcache_cooked_read (regcache, SPARC_F0_REGNUM + i, buf + i * 4); memcpy (valbuf, buf, len); } + else if (TYPE_CODE (type) == TYPE_CODE_ARRAY) + { + /* Small arrays are returned the same way as small records. */ + gdb_assert (len <= 32); + + for (i = 0; i < ((len + 7) / 8); i++) + regcache_cooked_read (regcache, SPARC_O0_REGNUM + i, buf + i * 8); + memcpy (valbuf, buf, len); + } else { /* Integral and pointer return values. */ @@ -1131,6 +1140,16 @@ sparc64_store_return_value (struct type for (i = 0; i < len / 4; i++) regcache_cooked_write (regcache, SPARC_F0_REGNUM + i, buf + i * 4); } + else if (TYPE_CODE (type) == TYPE_CODE_ARRAY) + { + /* Small arrays are returned the same way as small records. */ + gdb_assert (len <= 32); + + memset (buf, 0, sizeof (buf)); + memcpy (buf, valbuf, len); + for (i = 0; i < ((len + 7) / 8); i++) + regcache_cooked_write (regcache, SPARC_O0_REGNUM + i, buf + i * 8); + } else { /* Integral and pointer return values. */ --kXdP64Ggrk/fb43R--