From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 17103 invoked by alias); 26 Sep 2002 18:37:30 -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 17096 invoked from network); 26 Sep 2002 18:37:27 -0000 Received: from unknown (HELO mx1.redhat.com) (66.187.233.31) by sources.redhat.com with SMTP; 26 Sep 2002 18:37:27 -0000 Received: from int-mx1.corp.redhat.com (int-mx1.corp.redhat.com [172.16.52.254]) by mx1.redhat.com (8.11.6/8.11.6) with ESMTP id g8QIJLi16421 for ; Thu, 26 Sep 2002 14:19:21 -0400 Received: from pobox.corp.redhat.com (pobox.corp.redhat.com [172.16.52.156]) by int-mx1.corp.redhat.com (8.11.6/8.11.6) with ESMTP id g8QIbPf09211; Thu, 26 Sep 2002 14:37:25 -0400 Received: from localhost.localdomain (vpn50-15.rdu.redhat.com [172.16.50.15]) by pobox.corp.redhat.com (8.11.6/8.11.6) with ESMTP id g8QIbPJ07796; Thu, 26 Sep 2002 14:37:25 -0400 Received: (from kev@localhost) by localhost.localdomain (8.11.6/8.11.6) id g8QIbJs19071; Thu, 26 Sep 2002 11:37:19 -0700 Date: Thu, 26 Sep 2002 11:37:00 -0000 From: Kevin Buettner Message-Id: <1020926183719.ZM19070@localhost.localdomain> In-Reply-To: Andrew Cagney "[rfa/ppc] Use frame_align(); delete hack" (Sep 24, 7:07pm) References: <3D90F04C.9040900@redhat.com> To: Andrew Cagney , gdb-patches@sources.redhat.com Subject: Re: [rfa/ppc] Use frame_align(); delete hack MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-SW-Source: 2002-09/txt/msg00640.txt.bz2 On Sep 24, 7:07pm, Andrew Cagney wrote: > The extract struct return function is also modified so that it, for want > of a better guess, returns register 3. The other option is to have that > function return 0 (since it really doesn't know). [...] > + /* FIXME: This will only work at random. The caller passes the > + struct_return address in register 3, but it is not preserved. It > + may still be there, or this may be a random value. */ > + ULONGEST val; > + regcache_cooked_read_unsigned (regcache, 3, &val); > + return val; I think returning 0 here is a better idea. If the function that you're returning from has made any (non-nullary) calls, r3 will have been overwritten. Even if it doesn't make any calls, r3 is still fair game for the compiler to use as a temporary. I'd like to see a comment pointing out the fact that gdb knows about and is able to print struct return values in inferior function calls due to the fact that gdb is the caller (and therefore knows the address of the struct return buffer). Otherwise, okay. Kevin