From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 7058 invoked by alias); 24 Feb 2011 10:07:06 -0000 Received: (qmail 7036 invoked by uid 22791); 24 Feb 2011 10:07:04 -0000 X-SWARE-Spam-Status: No, hits=-2.2 required=5.0 tests=AWL,BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,TW_GC X-Spam-Check-By: sourceware.org Received: from mail-qy0-f182.google.com (HELO mail-qy0-f182.google.com) (209.85.216.182) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 24 Feb 2011 10:07:00 +0000 Received: by qyk27 with SMTP id 27so323916qyk.20 for ; Thu, 24 Feb 2011 02:06:58 -0800 (PST) MIME-Version: 1.0 Received: by 10.229.95.19 with SMTP id b19mr430837qcn.179.1298542018088; Thu, 24 Feb 2011 02:06:58 -0800 (PST) Received: by 10.229.49.85 with HTTP; Thu, 24 Feb 2011 02:06:57 -0800 (PST) In-Reply-To: References: Date: Thu, 24 Feb 2011 10:07:00 -0000 Message-ID: Subject: Re: Must unwind in gcc be ported for gcj? From: Bryce McKinlay To: majia gm Cc: Java List , gcc-help@gcc.gnu.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable 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: 2011-02/txt/msg00006.txt.bz2 On Thu, Feb 24, 2011 at 1:19 AM, majia gm wrote: > Hi, everyone. > > I'm porting gcj (gcc-4.4.2) to another platform. Right now the gij > fails when interpreting the following program. > > File A.java: > > import B; > public class A{ > > =A0 =A0 =A0 =A0public static void main(String args[]) > =A0 =A0 =A0 =A0{ > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0try{ > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0B b=3D(B)Class.forName("B"= ).newInstance(); > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0catch(Exception e) > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0{ > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0System.out.println("Cannot= find Class B"); > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0} > =A0 =A0 =A0 =A0} > } > > File B.java: > > public class B > {} > > I use gdb to track gij, and I found GetCallingClass() in forName() > returns NULL, then the bootstrap loader is used to search the Class B > but with no result. Should the Class B has the same class loader, the > system class loader as the Class A dose? > > Then I track the GetCallingClass(), and I found it needs the unwind > function provided by gcc. =A0Must I port the unwind function? > Have a look at SJLJ_EXCEPTIONS. This should allow you to get something working without having to port the full unwinder. Bryce