This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: Must unwind in gcc be ported for gcj?
- From: Bryce McKinlay <bmckinlay at gmail dot com>
- To: majia gm <gmmajia at gmail dot com>
- Cc: Java List <java at gcc dot gnu dot org>, gcc-help at gcc dot gnu dot org
- Date: Thu, 24 Feb 2011 10:06:57 +0000
- Subject: Re: Must unwind in gcc be ported for gcj?
- References: <AANLkTin-ZzjX2EA5HcxCe_a2UuwcexJzAgDaV8namDFz@mail.gmail.com>
On Thu, Feb 24, 2011 at 1:19 AM, majia gm <gmmajia@gmail.com> 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{
>
> ? ? ? ?public static void main(String args[])
> ? ? ? ?{
> ? ? ? ? ? ? ? ?try{
> ? ? ? ? ? ? ? ? ? ? ? ?B b=(B)Class.forName("B").newInstance();
> ? ? ? ? ? ? ? ?catch(Exception e)
> ? ? ? ? ? ? ? ?{
> ? ? ? ? ? ? ? ? ? ? ? ?System.out.println("Cannot find Class B");
> ? ? ? ? ? ? ? ?}
> ? ? ? ?}
> }
>
> 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. ?Must 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