From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 1809 invoked by alias); 7 Nov 2002 18:26:09 -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 1665 invoked from network); 7 Nov 2002 18:26:06 -0000 Received: from unknown (HELO fw-cam.cambridge.arm.com) (193.131.176.3) by sources.redhat.com with SMTP; 7 Nov 2002 18:26:06 -0000 Received: by fw-cam.cambridge.arm.com; id SAA16905; Thu, 7 Nov 2002 18:25:57 GMT Received: from unknown(172.16.1.2) by fw-cam.cambridge.arm.com via smap (V5.5) id xma016368; Thu, 7 Nov 02 18:25:16 GMT Received: from pc960.cambridge.arm.com (pc960.cambridge.arm.com [10.1.205.4]) by cam-admin0.cambridge.arm.com (8.9.3/8.9.3) with ESMTP id SAA15928; Thu, 7 Nov 2002 18:25:15 GMT Received: from pc960.cambridge.arm.com (rearnsha@localhost) by pc960.cambridge.arm.com (8.11.6/8.9.3) with ESMTP id gA7IPEM32490; Thu, 7 Nov 2002 18:25:14 GMT Message-Id: <200211071825.gA7IPEM32490@pc960.cambridge.arm.com> X-Authentication-Warning: pc960.cambridge.arm.com: rearnsha owned process doing -bs To: Michael Snyder cc: gdb-patches@sources.redhat.com, cagney@redhat.com, kevinb@redhat.com, rearnsha@arm.com Reply-To: Richard.Earnshaw@arm.com Organization: ARM Ltd. X-Telephone: +44 1223 400569 (direct+voicemail), +44 1223 400400 (switchbd) X-Fax: +44 1223 400410 X-Address: ARM Ltd., 110 Fulbourn Road, Cherry Hinton, Cambridge CB1 9NJ. Subject: Re: [RFA] arm_store_return_value, big-endian (take 2) In-reply-to: Your message of "Wed, 06 Nov 2002 16:27:29 PST." <3DC9B371.94245DDE@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Thu, 07 Nov 2002 10:26:00 -0000 From: Richard Earnshaw X-SW-Source: 2002-11/txt/msg00182.txt.bz2 > This fixes up offsets in arm_store_return_value for big-endian targets, > just as my first patch did for arm_extract_return_value. > > This supercedes the patch by the same name, which seems to have > been bollixed by an incomprehensible but reproducable bug in > gnu patch. > > 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 7 Nov 2002 00:22:13 -0000 > *************** arm_store_return_value (struct type *typ > *** 2417,2422 **** > --- 2417,2425 ---- > break; > } > } > + else if (TYPE_LENGTH (type) < REGISTER_RAW_SIZE (A1_REGNUM)) > + write_register_bytes (REGISTER_RAW_SIZE (A1_REGNUM) - TYPE_LENGTH (type), > + valbuf, TYPE_LENGTH (type)); > else > write_register_bytes (ARM_A1_REGNUM, valbuf, TYPE_LENGTH (type)); > } > 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. R.