The dbx group has implemented a new mixed-language Java and C/C++ debugger
called jdbx which works with Sun's JDK on Solaris. They have found that to
properly support bound threads it is necessary for them to create a debug
agent thread outside the JVM and then attach it using the JNI routine
AttachCurrentThread (instead of using the JVMDI's RunDebugThread); however,
AttachCurrentThread makes the new Java thread a non-daemon thread, which makes
the JVM wait for that thread to terminate before exiting. Further, it is not
possible to call setDaemon(true) on this new thread since it is considered to
have "started" by the time AttachCurrentThread returns.
Since this is a more general problem than just for debugging, we should add
a new routine to the JNI interface, AttachCurrentThreadAsDaemon, which has the
same effect as the existing AttachCurrentThread but which makes the Thread
object a daemon before "starting" it.
-------------------------------------
called jdbx which works with Sun's JDK on Solaris. They have found that to
properly support bound threads it is necessary for them to create a debug
agent thread outside the JVM and then attach it using the JNI routine
AttachCurrentThread (instead of using the JVMDI's RunDebugThread); however,
AttachCurrentThread makes the new Java thread a non-daemon thread, which makes
the JVM wait for that thread to terminate before exiting. Further, it is not
possible to call setDaemon(true) on this new thread since it is considered to
have "started" by the time AttachCurrentThread returns.
Since this is a more general problem than just for debugging, we should add
a new routine to the JNI interface, AttachCurrentThreadAsDaemon, which has the
same effect as the existing AttachCurrentThread but which makes the Thread
object a daemon before "starting" it.
-------------------------------------