This is the mail archive of the
java@gcc.gnu.org
mailing list for the Java project.
Re: GCJ and C++ (calling Java from C++)
Lothar Werzinger writes:
> On Monday 05 December 2005 03:39, Andrew Haley wrote:
> > Lothar Werzinger writes:
> > >From what I learned reading about CNI calling methods on interfaces
> > >requires a special dispatch table called otable.
> >
> > I don't think so. As far as I'm aware the otable is only ever
> > involved when a file has been compiled with -findirect dispatch. CNI
> > doesn't use indirect dispatch. Without indirect dispatch, we'd expect
> > the otable to be null.
>
> The jar and the Java file are compiled with -findirect-dispatch, so
> I think having a null otable is bad.
CNI doesn't use indirect dispatch.
> You should be able to see that in the build.xml in the project I
> sent you last time.
What you sent me last time didn't build. I tried for a while to get
it to build then gave up.
> > Which line? Does the failure occur in the call to get_name?
>
> As said in previous postings it fails either in
>
> JvInitClass(LibraryTestClass);
>
> or in
>
> String * p_name = p_library->getName();
>
> if I comment out the JvInitClass. If I do comment it out I get the following
> console ouput from some println's I do in the code:
>
> [exec] LibraryTest::class$.getName() = test.LibraryTest
> [exec] p_libraryTest->getClass()->getName() = test.LibraryTest
> [exec] Library::class$.getName() =
> org.eclipse.emf.examples.extlibrary.Library
> [exec] p_library->getClass()->getName() =
> org.eclipse.emf.examples.extlibrary.impl.LibraryImpl
>
> The LibraryImpl is the class that implements the Library interface.
>
> > What is the faulting instruction?
> >
> > The problem here is that we only have tiny snippets of information to
> > go on.
>
> As for the faulting instruction, what ezactly do you want me to do
> to find that? Send you the asm again? GDB output - if you tell me
> which commands to execute in gdb I would be happy to do
> that. Please tell me exactly how I can help you finding the
> problem. I can also send you the full tar again if you want to try
> to reproduce it by yourself.
It doesn't build.
If you can put a buildable tar somewhere I'll have a look. I have all
of Eclipse installed, and all of ant, etc, etc, so you don't have to
send any of that.
Andrew.