From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 4540 invoked by alias); 7 Jan 2003 23:46:23 -0000 Mailing-List: contact gdb-patches-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sources.redhat.com Received: (qmail 4533 invoked from network); 7 Jan 2003 23:46:21 -0000 Received: from unknown (HELO mx1.redhat.com) (66.187.233.31) by 209.249.29.67 with SMTP; 7 Jan 2003 23:46:21 -0000 Received: from int-mx2.corp.redhat.com (nat-pool-rdu-dmz.redhat.com [172.16.52.200]) by mx1.redhat.com (8.11.6/8.11.6) with ESMTP id h07NIUB03792 for ; Tue, 7 Jan 2003 18:18:30 -0500 Received: from potter.sfbay.redhat.com (potter.sfbay.redhat.com [172.16.27.15]) by int-mx2.corp.redhat.com (8.11.6/8.11.6) with ESMTP id h07Nk5n17083; Tue, 7 Jan 2003 18:46:05 -0500 Received: from redhat.com (reddwarf.sfbay.redhat.com [172.16.24.50]) by potter.sfbay.redhat.com (8.11.6/8.11.6) with ESMTP id h07Nk4n03499; Tue, 7 Jan 2003 15:46:04 -0800 Message-ID: <3E1B66BC.B5D75FEA@redhat.com> Date: Tue, 07 Jan 2003 23:46:00 -0000 From: Michael Snyder Organization: Red Hat, Inc. X-Accept-Language: en MIME-Version: 1.0 To: Richard.Earnshaw@arm.com CC: Fernando Nasser , gdb-patches@sources.redhat.com, rearnsha@arm.com, cagney@redhat.com, kevinb@redhat.com, fnasser Subject: Re: [RFA] arm_extract_return_value, big-endian References: <200212041002.gB4A27w05408@pc960.cambridge.arm.com> Content-Type: multipart/mixed; boundary="------------ABC28BD0CDEBC504FCAF751A" X-SW-Source: 2003-01/txt/msg00301.txt.bz2 This is a multi-part message in MIME format. --------------ABC28BD0CDEBC504FCAF751A Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Content-length: 632 Richard Earnshaw wrote: > > fnasser@redhat.com said: > > Humm..., I am having second thoughts about this. Isn't the problem > > you are seeing the same problem of not having the values peoperly > > sign-extended? > > No. In this case we really need to copy the least significant 1 (or 2) > bytes into the 1 or 2 bytes in the valbuf target. That means doing a copy > from the higher addresses. So in that respect, the patch is correct. > > But it breaks the case where the return value is more than one word. Yes, I see that now. Richard, how about a joint effort? Would you be so kind as to fill in the empty else clause? --------------ABC28BD0CDEBC504FCAF751A Content-Type: text/plain; charset=us-ascii; name="arm.diff" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="arm.diff" Content-length: 793 Index: arm-tdep.c =================================================================== RCS file: /cvs/src/src/gdb/arm-tdep.c,v retrieving revision 1.74 diff -p -r1.74 arm-tdep.c *** arm-tdep.c 1 Nov 2002 21:21:49 -0000 1.74 --- arm-tdep.c 7 Jan 2003 23:45:19 -0000 *************** arm_extract_return_value (struct type *t *** 2274,2279 **** --- 2274,2292 ---- break; } } + else if (TARGET_BYTE_ORDER == BFD_ENDIAN_BIG) + { + if (TYPE_LENGTH (type) <= REGISTER_SIZE) + { + memcpy (valbuf, + ®buf[REGISTER_BYTE (ARM_A1_REGNUM)] + + (REGISTER_RAW_SIZE (ARM_A1_REGNUM) - TYPE_LENGTH (type)), + TYPE_LENGTH (type)); + } + else + { + } + } else memcpy (valbuf, ®buf[REGISTER_BYTE (ARM_A1_REGNUM)], TYPE_LENGTH (type)); --------------ABC28BD0CDEBC504FCAF751A--