From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 31033 invoked by alias); 22 Aug 2002 19:11:54 -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 30930 invoked from network); 22 Aug 2002 19:11:52 -0000 Received: from unknown (HELO localhost.redhat.com) (216.138.202.10) by sources.redhat.com with SMTP; 22 Aug 2002 19:11:52 -0000 Received: from ges.redhat.com (localhost [127.0.0.1]) by localhost.redhat.com (Postfix) with ESMTP id BB9803C48; Thu, 22 Aug 2002 15:11:50 -0400 (EDT) Message-ID: <3D653776.10407@ges.redhat.com> Date: Thu, 22 Aug 2002 13:04:00 -0000 From: Andrew Cagney User-Agent: Mozilla/5.0 (X11; U; NetBSD macppc; en-US; rv:1.0.0) Gecko/20020810 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Michael Snyder Cc: gdb-patches@sources.redhat.com, kevinb@redhat.com, cagney@redhat.com, Elena Zannoni Subject: Re: [RFC] fixing extract_struct_value_address References: <3D6418C5.FBF117D@redhat.com> <3D65001C.70609@ges.redhat.com> <3D652594.3424CD7D@redhat.com> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-SW-Source: 2002-08/txt/msg00706.txt.bz2 > I get the feeling that all that is needed is for the above to be enabled >> for all targets. >> >> enjoy, >> Andrew > > > Wouldn't that only work for targets that return the value on the stack? > Those targets already work properly (I think the 386 is one). > I'm concerned here with targets where the struct is returned > by reference (thru a pointer provided by the caller.) See: /* elz: I defined this new macro for the hppa architecture only. this gives us a way to get the value returned by the function from the stack, at the same address we told the function to put it. We cannot assume on the pa that r28 still contains the address of the returned structure. Usually this will be overwritten by the callee. I don't know about other architectures, so I defined this macro */ The comment appears to describe a situtation identical to yours. As for the more generic problem, per: > Discussed before in: > > http://sources.redhat.com/ml/gdb-patches/2001-11/msg00571.html > and > http://sources.redhat.com/ml/gdb-patches/2001-12/msg00325.html > > never resolved. > > Elena My understanding is that, for some ABIs, it just isn't possible to find the address of the returned value (unless debug info (cfi?) somehow helps). For such cases, I think EXTRACT_STRUCT_VALUE_ADDRESS() should return zero. enjoy, Andrew