This is the mail archive of the
java-patches@gcc.gnu.org
mailing list for the Java project.
Re: [RFA] Suspend counting for JDWP
Keith Seitz wrote:
Are we likely to need to associate other JVMTI/JDWP debugging data
with a thread? If so then it might be wise to put these in a
_Jv_ThreadDebugInfo (or some such) struct which would be initialized
only when JDWP is in use.
JVMTI defines the following thread-related functions:
All of these things basically mirror JDWP information, and all of it
is contained within the thread. JVMTI does not give access to suspend
counts the way JDWP does.
OK, it looks like a separate ThreadDebugInfo struct is not required.
Of course, nothing stops us from implementing JVMTI right along with
JDWP, since the two do obviously overlap in many ways. But that was
well outside the scope of the project.
You could think of JVMTI as the low-level interface through which the
JDWP implementation should communicate with the VM. If we were to
implement JDWP without JVMTI, then we'd just end up duplicating much of
JVMTI anyway.
Clearly, "jvmtiError SuspendThread(jvmtiEnv* env, jthread thread)" is
more-or-less equivalent to "_Jv_DebugSuspendThread(_Jv_Thread_t)".
I'd argue that anything additional to what is provided by JVMTI, such as
suspend counts, should be implemented in the JDWP code itself and
doesn't need to be dealt with in the core runtime.
So, the question is: do maintainers want to start implementing JVMTI
and switch over to use it now or wait and implement the whole thing?
I'm sure that these threading issues are not the only place this route
could have been chosen.
Its your call. Certainly if you think JVMTI is going to hold up JDWP
work, I wouldn't want to see too much time spent on it. But, I think
that implementing the parts needed by JDWP shouldn't be a huge
undertaking, It should actually be helpful, by clearly defining the
interfaces through which JDWP should communicate with the VM, rather
than ending up with bits and pieces of JDWP support code scattered around.
I'm not suggesting should we be trying to implement the full JVMTI spec
at this stage - just the bits that are directly used by the JDWP
features we are going to support.
Bryce