From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 19491 invoked by alias); 15 Jul 2004 14:21:44 -0000 Mailing-List: contact gdb-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sources.redhat.com Received: (qmail 19484 invoked from network); 15 Jul 2004 14:21:43 -0000 Received: from unknown (HELO mx1.redhat.com) (66.187.233.31) by sourceware.org with SMTP; 15 Jul 2004 14:21:43 -0000 Received: from int-mx1.corp.redhat.com (int-mx1.corp.redhat.com [172.16.52.254]) by mx1.redhat.com (8.12.10/8.12.10) with ESMTP id i6FELhe3003424 for ; Thu, 15 Jul 2004 10:21:43 -0400 Received: from localhost.redhat.com (to-dhcp51.toronto.redhat.com [172.16.14.151]) by int-mx1.corp.redhat.com (8.11.6/8.11.6) with ESMTP id i6FELg014810; Thu, 15 Jul 2004 10:21:42 -0400 Received: from gnu.org (localhost [127.0.0.1]) by localhost.redhat.com (Postfix) with ESMTP id 9645E2B9D; Thu, 15 Jul 2004 10:21:39 -0400 (EDT) Message-ID: <40F692F3.1060302@gnu.org> Date: Thu, 15 Jul 2004 14:36:00 -0000 From: Andrew Cagney User-Agent: Mozilla/5.0 (X11; U; NetBSD macppc; en-GB; rv:1.4.1) Gecko/20040217 MIME-Version: 1.0 To: Daniel Jacobowitz , Chris Zankel Cc: gdb@sources.redhat.com Subject: Re: Extract the return value in finish_command on Xtensa. References: <40F31BA9.2060101@tensilica.com> <40F58BBA.5060300@gnu.org> <20040714195925.GA20006@nevyn.them.org> In-Reply-To: <20040714195925.GA20006@nevyn.them.org> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-SW-Source: 2004-07/txt/msg00167.txt.bz2 > On Wed, Jul 14, 2004 at 03:38:34PM -0400, Andrew Cagney wrote: > >>>> >I am working on a port of GDB to the Xtensa architecture. >>>> > >>>> >Unfortunately, it is impossible on Xtensa to extract the return value once >>>> >the 'callee' has returned to the 'caller' without analyzing the call >>>> >instruction (if there was one). Depending on the call instruction, the >>>> >return value can be in register a6, a10, oder a14. >> >>> >>> Puzzled expression. The ABI should specify which return-value >>> convention will be used? >>> >>> I suspect you'll need to explain a little more about your architecture. > > > Xtensa has register windows. The call instruction determines how far > the window shifts; the return value is always going to be in some fixed > register (a0?) at the end of the function, but the caller has to choose > which call instruction to use and expect the return value in the > correct location based on that. Keep going :-) For instance, what logic determines the shift amount (the insn just reflects that decision), and how does the mechanism compare to ia64 and SPARC? Andrew