Debugging java code launched from c code

Hi,

I have C code that must create a JVM through the JNI invocation interface and later make several Java method calls. Is there a way to debug Java code called from C functions. My C code is not standalone but is run from an external db plugin (I can only customize this code). I probably have no way to attach a debugger to the C code. Is there a way I can attach a debugger to a JVM created at run time. Is it possible to do the debugging with Eclipse or some other graphical tool ?

Thanks.

[512 byte] By [Dummya] at [2007-11-27 8:08:38]
# 1

While invoking JVM pass to it parameters:

-Xrunjdwp:transport=dt_socket,address=8880,server=y,suspend=y

where

address=8880 a socket number you connect your Java IDE to (remote debugging). Instead 8880 you can select any free socket number.

suspend=y means that JNI code will stop untill you connect Java Debugger from IDE.

In Java IDE you should set in Debugger the same socket number you selected in JNI code.

vitallisa at 2007-7-12 19:51:37 > top of Java-index,Java HotSpot Virtual Machine,Specifications...