[kaffe] Inlining BEGIN/END_EXCEPTION_HANDLING macros in jni.c (Was: Re: [kaffe] Moving away from macros to inlined functions)
Dalibor Topic
robilad at kaffe.org
Sun Sep 21 09:50:04 PDT 2003
Guilhem Lavaux wrote:
> Dalibor Topic wrote:
>
>> Hi,
>>
>> this is a simple code hygene issue: I'd like to move away from using
>> preprocessor macros all over kaffe's C sources, to use inline
>> functions. Since the gdb debugger has a much better time with inlines,
>> the gcc compiler produces more useful error and warning messages,
>> inlines can be prototyped to check for type violations, and so on.
>>
>> I'd like to start with BEGIN/END_EXCEPTION_HANDLING in jni.c and the
>> sysdepCallMethod on arm, as that's what I'm trying to debug at the
>> moment. Is everyone O.K. with the idea to move away from macros?
>>
>> cheers,
>> dalibor topic
>
>
> As far as it doesn't complicate kaffe's structure I don't see why we
> should keep them. By the way, introducing true function calls helps the
> programmers to keep a clean way to program. Usually macros are bad
> used... So this should be done at a time or another. I am for it.
Seems that it not always easy to do without crashing kaffe badly. I
tried my luck with the BEGIN/END_EXCEPTION_HANDLING macros in jni.c but
I got only crashes during regression tests while compiling the tests:
gmake[4]: Entering directory `/tmp/topic/build/test/regression'
TestScript ../../../kaffe/test/regression/HelloWorldApp.java
testing ../../../kaffe/test/regression/HelloWorldApp.java
JAVA_SRCS=../../../kaffe/test/regression/HelloWorldApp.java
/tmp/topic/build/kaffe/kaffe/kaffe-bin -noverify at.dms.kjc.Main
-classpath
".:../../../kaffe/test/regression:compile_time:/HG/hiwis/topic/jars/antlrall.jar:/HG/hiwis/topic/jars/bsf.jar:/HG/hiwis/topic/jars/junit.jar::.:.:/tmp/topic/kaffe/libraries/javalib/kjc.jar::.:/tmp/topic/kaffe/libraries/javalib/kjc.jar:"
-d . ../../../kaffe/test/regression/HelloWorldApp.java
error compiling:
Internal error: caught an unexpected exception.
Please check your CLASSPATH and your installation.
java/lang/UnsatisfiedLinkError: libio: not found
at java.lang.NativeLibrary.linkLibrary(NativeLibrary.java:native)
at java.lang.NativeLibrary.<init>(NativeLibrary.java:40)
at java.lang.Class.getClassLoader0(Class.java:native)
at java.lang.System.loadLibrary(System.java:122)
at java.io.File.<clinit>(File.java:102)
at java.lang.NativeLibrary.getLibraryNames(NativeLibrary.java:51)
at java.lang.Class.getClassLoader0(Class.java:native)
at java.lang.System.loadLibrary(System.java:122)
at java.io.FileDescriptor.<clinit>(FileDescriptor.java:77)
at java.lang.System.<clinit>(System.java:48)
at java.lang.Throwable.<clinit>(Throwable.java:403)
TestScript: line -45: 27180 Aborted
/tmp/topic/build/kaffe/kaffe/kaffe-bin -noverify at.dms.kjc.Main
-classpath
".:../../../kaffe/test/regression:compile_time:/HG/hiwis/topic/jars/antlrall.jar:/HG/hiwis/topic/jars/bsf.jar:/HG/hiwis/topic/jars/junit.jar::.:.:/tmp/topic/kaffe/libraries/javalib/kjc.jar::.:/tmp/topic/kaffe/libraries/javalib/kjc.jar:"
-d . ../../../kaffe/test/regression/HelloWorldApp.java
FAIL: HelloWorldApp.java
================================
1 of 1 tests failed
Please report to kaffe at kaffe.org
================================
the weird bit is that the compilation worked without a hitch when I ran
the installed, compiled kaffe with the patched jni.c. I tried to figure
out what was going on, but I kept running against a wall. So if anyone
here has an idea, I've attached the diff to this mail for your debugging
pleasures.
cheers,
dalibor topic
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: jni.diff
Url: http://kaffe.org/pipermail/kaffe/attachments/20030921/a2c35820/attachment-0002.txt
More information about the kaffe
mailing list