From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 861 invoked by alias); 17 Apr 2003 17:44: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 851 invoked from network); 17 Apr 2003 17:44:09 -0000 Received: from unknown (HELO mx1.redhat.com) (66.187.233.31) by sources.redhat.com with SMTP; 17 Apr 2003 17:44:09 -0000 Received: from int-mx2.corp.redhat.com (nat-pool-rdu-dmz.redhat.com [172.16.52.200] (may be forged)) by mx1.redhat.com (8.11.6/8.11.6) with ESMTP id h3HHi8D24092 for ; Thu, 17 Apr 2003 13:44:09 -0400 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 h3HHi8W10572; Thu, 17 Apr 2003 13:44:08 -0400 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 h3HHi7M29079; Thu, 17 Apr 2003 10:44:07 -0700 Message-ID: <3E9EE7E7.B91EFA27@redhat.com> Date: Thu, 17 Apr 2003 17:44:00 -0000 From: Michael Snyder Organization: Red Hat, Inc. X-Accept-Language: en MIME-Version: 1.0 To: Elena Zannoni CC: gdb-patches@sources.redhat.com Subject: Re: [RFA] values.c: don't fetch func void return value References: <16029.54499.392215.696866@localhost.redhat.com> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-SW-Source: 2003-04/txt/msg00342.txt.bz2 Elena Zannoni wrote: > > While debugging the x86-64 I noticed that there were problems because > gdb was trying to extract a void return value from a function. It > already has set up the value structure with all the correct fields, Meaning the correct fields for a void return? > it > seems a waste to go and ask the target for a value if we know there > isn't one. Seems reasonable to me... and I don't see any specific maintainer. [donning appropriate hat] Bless you, my child... > 2003-04-16 Elena Zannoni > > * values.c (value_being_returned): Don't fetch the return > value if the return type is void. > > Index: values.c > =================================================================== > RCS file: /cvs/uberbaum/gdb/values.c,v > retrieving revision 1.47 > diff -u -p -r1.47 values.c > --- values.c 20 Feb 2003 00:01:07 -0000 1.47 > +++ values.c 16 Apr 2003 21:29:19 -0000 > @@ -1240,7 +1240,9 @@ value_being_returned (struct type *valty > > val = allocate_value (valtype); > CHECK_TYPEDEF (valtype); > - EXTRACT_RETURN_VALUE (valtype, retbuf, VALUE_CONTENTS_RAW (val)); > + /* If the function returns void, don't bother fetching the return value. */ > + if (TYPE_CODE (valtype) != TYPE_CODE_VOID) > + EXTRACT_RETURN_VALUE (valtype, retbuf, VALUE_CONTENTS_RAW (val)); > > return val; > }