From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 8147 invoked by alias); 26 Oct 2002 17:23:12 -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 7902 invoked from network); 26 Oct 2002 17:23:09 -0000 Received: from unknown (HELO localhost.redhat.com) (24.112.240.27) by sources.redhat.com with SMTP; 26 Oct 2002 17:23:09 -0000 Received: from redhat.com (localhost [127.0.0.1]) by localhost.redhat.com (Postfix) with ESMTP id 78B4F3F3A; Sat, 26 Oct 2002 13:23:08 -0400 (EDT) Message-ID: <3DBACF7C.4010403@redhat.com> Date: Sat, 26 Oct 2002 10:23:00 -0000 From: Andrew Cagney User-Agent: Mozilla/5.0 (X11; U; NetBSD macppc; en-US; rv:1.0.0) Gecko/20020824 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Mark Kettenis Cc: gdb-patches@sources.redhat.com Subject: Re: [PATCH] Address FIXME in i386-tdep.c:i386_extract_struct_value_address References: <200210261441.g9QEff6t004409@elgar.kettenis.dyndns.org> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-SW-Source: 2002-10/txt/msg00568.txt.bz2 > We know for sure here that we're not dealing with a cooked register. That's what you think :-) It's more correct here to use the cooked interface. Andrew > Checked in. > > Mark > > Index: ChangeLog > from Mark Kettenis > > * i386-tdep.c (i386_extract_struct_value_address): Use > regcache_raw_read_unsigned instead of > regcache_cooked_read_unsigned since we know that the register > we're reading isn't a pseudo register. Rename variable 'val' into > the more descriptive 'addr'. > > Index: i386-tdep.c > =================================================================== > RCS file: /cvs/src/src/gdb/i386-tdep.c,v > retrieving revision 1.88 > diff -u -p -r1.88 i386-tdep.c > --- i386-tdep.c 17 Sep 2002 20:42:01 -0000 1.88 > +++ i386-tdep.c 26 Oct 2002 14:39:42 -0000 > @@ -1039,25 +1039,17 @@ i386_store_return_value (struct type *ty > } > } > > -/* Extract from an array REGBUF containing the (raw) register state > - the address in which a function should return its structure value, > - as a CORE_ADDR. */ > +/* Extract from REGCACHE, which contains the (raw) register state, the > + address in which a function should return its structure value, as a > + CORE_ADDR. */ > > static CORE_ADDR > i386_extract_struct_value_address (struct regcache *regcache) > { > - /* NOTE: cagney/2002-08-12: Replaced a call to > - regcache_raw_read_as_address() with a call to > - regcache_cooked_read_unsigned(). The old, ...as_address function > - was eventually calling extract_unsigned_integer (via > - extract_address) to unpack the registers value. The below is > - doing an unsigned extract so that it is functionally equivalent. > - The read needs to be cooked as, otherwise, it will never > - correctly return the value of a register in the [NUM_REGS > - .. NUM_REGS+NUM_PSEUDO_REGS) range. */ > - ULONGEST val; > - regcache_cooked_read_unsigned (regcache, LOW_RETURN_REGNUM, &val); > - return val; > + ULONGEST addr; > + > + regcache_raw_read_unsigned (regcache, LOW_RETURN_REGNUM, &addr); > + return addr; > } > > >