This is the mail archive of the java@gcc.gnu.org mailing list for the Java project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

bad news re: mingw exceptions



Ugh, this is really bad; C++ exceptions work, Java exceptions don't
(see below).

Can anybody tell me the differences in how they are implemented? CNI
would lead me to believe that they both get compiled the same way.

This stuff worked in the 12-Dec tree; has anything changed in
exception handling since then? I tried this same program in my old
12-Dec tree and it works.

  - a

______________________________________________________________________________
Java only:

public class test {
    public static void main(String[] s) {
      try {
        throw new Exception();
      } catch (Exception e) {
      }
    }
}

$ ./test.exe
Exception in thread "LibgcjInternalFinalizerThread" 

______________________________________________________________________________
CNI:

public class test {
  public static native void main(String[] s);
}

#include<gcj/cni.h>
#include<stdio.h>
#include<java/lang/Exception.h>
#include "test.h"

void test::main(JArray<jstring>*) {
  try {
    throw new java::lang::Exception();
  } catch (java::lang::Exception* f) {
  }
}

$ ./test.exe
[runs with no errors]


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]