From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 17830 invoked by alias); 8 Jun 2006 19:17:39 -0000 Received: (qmail 17765 invoked by uid 22791); 8 Jun 2006 19:17:38 -0000 X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (66.187.233.31) by sourceware.org (qpsmtpd/0.31) with ESMTP; Thu, 08 Jun 2006 19:17:36 +0000 Received: from int-mx1.corp.redhat.com (int-mx1.corp.redhat.com [172.16.52.254]) by mx1.redhat.com (8.12.11.20060308/8.12.11) with ESMTP id k58JHYwj014734; Thu, 8 Jun 2006 15:17:34 -0400 Received: from potter.sfbay.redhat.com (potter.sfbay.redhat.com [172.16.27.15]) by int-mx1.corp.redhat.com (8.12.11.20060308/8.12.11) with ESMTP id k58JHX5c003996; Thu, 8 Jun 2006 15:17:33 -0400 Received: from [172.16.24.50] (bluegiant.sfbay.redhat.com [172.16.24.50]) by potter.sfbay.redhat.com (8.12.8/8.12.8) with ESMTP id k58JHV71001972; Thu, 8 Jun 2006 15:17:32 -0400 Message-ID: <448877CB.1010106@redhat.com> Date: Thu, 08 Jun 2006 19:17:00 -0000 From: Michael Snyder User-Agent: Mozilla Thunderbird 1.0.7-1.4.1 (X11/20050929) MIME-Version: 1.0 To: GDB Patches CC: Joel Brobecker , Fred Fish Subject: Re: [RFA] replace stub fn mips_eabi_return_value References: <447E2CF3.4070102@redhat.com> In-Reply-To: <447E2CF3.4070102@redhat.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-IsSubscribed: yes Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2006-06/txt/msg00079.txt.bz2 Ping? Michael Snyder wrote: > ... just as Fred Fish recently did for the o64 version. > > > ------------------------------------------------------------------------ > > 2006-05-31 Michael Snyder > > * mips-tdep.c (mips_eabi_return_value): Replace stub that always > returned RETURN_VALUE_STRUCT_CONVENTION with a real function. > > Index: mips-tdep.c > =================================================================== > RCS file: /cvs/src/src/gdb/mips-tdep.c,v > retrieving revision 1.393 > diff -p -r1.393 mips-tdep.c > *** mips-tdep.c 31 May 2006 23:15:50 -0000 1.393 > --- mips-tdep.c 31 May 2006 23:52:56 -0000 > *************** mips_eabi_return_value (struct gdbarch * > *** 2651,2664 **** > struct type *type, struct regcache *regcache, > gdb_byte *readbuf, const gdb_byte *writebuf) > { > if (TYPE_LENGTH (type) > 2 * mips_abi_regsize (gdbarch)) > return RETURN_VALUE_STRUCT_CONVENTION; > ! if (readbuf) > ! memset (readbuf, 0, TYPE_LENGTH (type)); > return RETURN_VALUE_REGISTER_CONVENTION; > } > > - > /* N32/N64 ABI stuff. */ > > static CORE_ADDR > --- 2651,2712 ---- > struct type *type, struct regcache *regcache, > gdb_byte *readbuf, const gdb_byte *writebuf) > { > + struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch); > + int fp_return_type = 0; > + int offset, regnum, xfer; > + > if (TYPE_LENGTH (type) > 2 * mips_abi_regsize (gdbarch)) > return RETURN_VALUE_STRUCT_CONVENTION; > ! > ! /* Floating point type? */ > ! if (tdep->mips_fpu_type != MIPS_FPU_NONE) > ! { > ! if (TYPE_CODE (type) == TYPE_CODE_FLT) > ! fp_return_type = 1; > ! /* Structs with a single field of float type > ! are returned in a floating point register. */ > ! if ((TYPE_CODE (type) == TYPE_CODE_STRUCT > ! || TYPE_CODE (type) == TYPE_CODE_UNION) > ! && TYPE_NFIELDS (type) == 1) > ! { > ! struct type *fieldtype = TYPE_FIELD_TYPE (type, 0); > ! > ! if (TYPE_CODE (check_typedef (fieldtype)) == TYPE_CODE_FLT) > ! fp_return_type = 1; > ! } > ! } > ! > ! if (fp_return_type) > ! { > ! /* A floating-point value belongs in the least significant part > ! of FP0/FP1. */ > ! if (mips_debug) > ! fprintf_unfiltered (gdb_stderr, "Return float in $fp0\n"); > ! regnum = mips_regnum (gdbarch)->fp0; > ! } > ! else > ! { > ! /* An integer value goes in V0/V1. */ > ! if (mips_debug) > ! fprintf_unfiltered (gdb_stderr, "Return scalar in $v0\n"); > ! regnum = MIPS_V0_REGNUM; > ! } > ! for (offset = 0; > ! offset < TYPE_LENGTH (type); > ! /* offset += register_size (gdbarch, regnum), regnum++) */ > ! offset += mips_stack_argsize (gdbarch), regnum++) > ! { > ! /* xfer = register_size (gdbarch, regnum); */ > ! xfer = mips_stack_argsize (gdbarch); > ! if (offset + xfer > TYPE_LENGTH (type)) > ! xfer = TYPE_LENGTH (type) - offset; > ! mips_xfer_register (regcache, NUM_REGS + regnum, xfer, > ! TARGET_BYTE_ORDER, readbuf, writebuf, offset); > ! } > ! > return RETURN_VALUE_REGISTER_CONVENTION; > } > > /* N32/N64 ABI stuff. */ > > static CORE_ADDR