From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 21816 invoked by alias); 31 Jul 2003 02:26:24 -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 21807 invoked from network); 31 Jul 2003 02:26:22 -0000 Received: from unknown (HELO localhost.redhat.com) (24.157.166.107) by sources.redhat.com with SMTP; 31 Jul 2003 02:26:22 -0000 Received: from redhat.com (localhost [127.0.0.1]) by localhost.redhat.com (Postfix) with ESMTP id 7849B2B7F; Wed, 30 Jul 2003 22:26:21 -0400 (EDT) Message-ID: <3F287E4D.9040106@redhat.com> Date: Thu, 31 Jul 2003 02:26:00 -0000 From: Andrew Cagney User-Agent: Mozilla/5.0 (X11; U; NetBSD macppc; en-US; rv:1.0.2) Gecko/20030223 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Michael Snyder Cc: gdb-patches@sources.redhat.com, eliz@is.elta.co.il Subject: Re: [SO obvious...] make struct_return work for hand_function_call References: <3F28321A.7040201@redhat.com> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-SW-Source: 2003-07/txt/msg00549.txt.bz2 > God, we've struggled with this for years... the answer is so obvious! Er, struct return already works for hand call functions. Vis: /* NOTE: cagney/2002-09-10: Only when the stack has been correctly aligned (using frame_align()) do we can trust STRUCT_ADDR and fetch the return value direct from the stack. This lack of trust comes about because legacy targets have a nasty habit of silently, and local to PUSH_ARGUMENTS(), moving STRUCT_ADDR. For such targets, just hope that value_being_returned() can find the adjusted value. */ if (struct_return && gdbarch_frame_align_p (current_gdbarch)) { struct value *retval = value_at (value_type, struct_addr, NULL); do_cleanups (retbuf_cleanup); return retval; } else { struct value *retval = value_being_returned (value_type, retbuf, struct_return); do_cleanups (retbuf_cleanup); return retval; } If your architecture provides frame_align(), and does not it will all work. I think all those changes can be reverted. > Eli, this generalizes some special-purpose code that you wrote for HP, > which now becomes redundant and may be removed. BTW, Elz is Elena. Andrew