From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 2024 invoked by alias); 19 Dec 2009 10:51:05 -0000 Received: (qmail 2016 invoked by uid 22791); 19 Dec 2009 10:51:04 -0000 X-SWARE-Spam-Status: No, hits=-2.5 required=5.0 tests=AWL,BAYES_00,SPF_HELO_PASS,SPF_PASS X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Sat, 19 Dec 2009 10:50:59 +0000 Received: from int-mx04.intmail.prod.int.phx2.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.17]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id nBJAou9U011220 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Sat, 19 Dec 2009 05:50:56 -0500 Received: from zebedee.pink (ovpn01.gateway.prod.ext.phx2.redhat.com [10.5.9.1]) by int-mx04.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id nBJAosX1011509; Sat, 19 Dec 2009 05:50:55 -0500 Message-ID: <4B2CB00D.5070405@redhat.com> Date: Sat, 19 Dec 2009 10:51:00 -0000 From: Andrew Haley User-Agent: Thunderbird 2.0.0.23 (X11/20090825) MIME-Version: 1.0 To: Jack Howarth CC: java@gcc.gnu.org Subject: Re: _Unwind_FindEnclosingFunction vs darwin References: <20091218144617.GA21353@bromo.med.uc.edu> <4B2B9934.7010205@redhat.com> <20091218204147.GA23604@bromo.med.uc.edu> In-Reply-To: <20091218204147.GA23604@bromo.med.uc.edu> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-IsSubscribed: yes Mailing-List: contact java-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: java-owner@gcc.gnu.org X-SW-Source: 2009-12/txt/msg00041.txt.bz2 Jack Howarth wrote: > On Fri, Dec 18, 2009 at 03:01:08PM +0000, Andrew Haley wrote: >> _Unwind_Find_FDE is a standard function. Does Darwin support that? >> > > Andrew, > I believe we do have _Unwind_Find_FDE on darwin10 but it > is only functional if compact unwind information isn't used. > This is currently the case in gcc trunk since I disabled > the darwin10 linker's default of using compact unwind info > to avoid issues with the new epilog unwind info on the > darwin10 linker. > Shouldn't we be able to add something like... > > void * > darwin10_Unwind_FindEnclosingFunction (void *pc) > { > struct dwarf_eh_bases bases; > const struct dwarf_fde *fde = _Unwind_Find_FDE (pc-1, &bases); > if (fde) > return bases.func; > else > return NULL; > } > > and use... > > #undefine _Unwind_FindEnclosingFunction(PC) > #define _Unwind_FindEnclosingFunction(PC) darwin10_Unwind_FindEnclosingFunction(PC) > > to avoid the system _Unwind_FindEnclosingFunction() on darwin10? Sure. > I assume that darwin10_Unwind_FindEnclosingFunction code would have to go into > libjava/darwin.cc. However, I am unclear where to place... > > #undefine _Unwind_FindEnclosingFunction(PC) > #define _Unwind_FindEnclosingFunction(PC) darwin10_Unwind_FindEnclosingFunction(PC) It can either go in include/config.h if it's autoconf'd or perhaps in one of the libgcj include files. The easiest thing would be to add #ifdef USING_DARWIN_CRT #undefine _Unwind_FindEnclosingFunction(PC) #define _Unwind_FindEnclosingFunction(PC) darwin10_Unwind_FindEnclosingFunction(PC) #endif to include/posix.h. Please make sure that darwin10_Unwind_FindEnclosingFunction is not exported from anywhere. I'd just declare it static inline in include/posix.h. Andrew.