From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 18450 invoked by alias); 8 Nov 2002 03:19:53 -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 18442 invoked from network); 8 Nov 2002 03:19:51 -0000 Received: from unknown (HELO mx1.redhat.com) (66.187.233.31) by sources.redhat.com with SMTP; 8 Nov 2002 03:19:51 -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 gA82v6w04741 for ; Thu, 7 Nov 2002 21:57:06 -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 gA83Jml14509; Thu, 7 Nov 2002 22:19:48 -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 gA83JlD22719; Thu, 7 Nov 2002 19:19:47 -0800 Message-ID: <3DCB2D53.E19B382A@redhat.com> Date: Thu, 07 Nov 2002 19:19:00 -0000 From: Michael Snyder Organization: Red Hat, Inc. X-Accept-Language: en MIME-Version: 1.0 To: Richard.Earnshaw@arm.com CC: gdb-patches@sources.redhat.com, cagney@redhat.com, kevinb@redhat.com Subject: Re: [RFA] arm_store_return_value, big-endian (take 2) References: <200211071825.gA7IPEM32490@pc960.cambridge.arm.com> Content-Type: multipart/mixed; boundary="------------3A45342B16736D9C85B5F141" X-SW-Source: 2002-11/txt/msg00213.txt.bz2 This is a multi-part message in MIME format. --------------3A45342B16736D9C85B5F141 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Content-length: 427 Richard Earnshaw wrote: > > Leaving asside the issue of the correctness of write_register_bytes (note > to self, must finish of my register patches), I don't think this is > correct -- in fact, I think it's also wrong for little-endian as well. > > What should happen is that the smaller-than-word value should be > zero/sign-extended to 32 bits and then the whole thing stored in A1_REGNUM. Ah, thanks. OK, how about this? --------------3A45342B16736D9C85B5F141 Content-Type: text/plain; charset=us-ascii; name="arm5.patch" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="arm5.patch" Content-length: 838 2002-11-06 Michael Snyder * arm-tdep.c (arm_store_return_value): Handle offset of small types on big-endian machines. 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 8 Nov 2002 03:17:49 -0000 *************** arm_store_return_value (struct type *typ *** 2417,2422 **** --- 2417,2429 ---- break; } } + else if (TYPE_LENGTH (type) < REGISTER_RAW_SIZE (A1_REGNUM) + && TARGET_BYTE_ORDER == BFD_ENDIAN_BIG) + { + LONGEST tmp = unpack_long (type, valbuf); + + write_register (ARM_A1_REGNUM, tmp); + } else write_register_bytes (ARM_A1_REGNUM, valbuf, TYPE_LENGTH (type)); } --------------3A45342B16736D9C85B5F141--