On Nov 21, 2007 3:14 AM, Gregory Shimansky <[EMAIL PROTECTED]> wrote: > Rana Dasgupta wrote: > > On 11/20/07, Gregory Shimansky <[EMAIL PROTECTED]> wrote: > >> Eugene Ostrovsky wrote: > >>> It seems that we have a regression. > >>> > >>> org.apache.harmony.jpda.tests.jdwp.Events.ClassUnloadTest > >>> starts to fail from r596304 to r596371 > >>> So it seems that now that class unloading is enabled, JVMTI extension > >>> event for class unloading has to be implemented to let this test pass. > >>> The problem that I see here is that Sun's implementation passes a > >>> reference to the unloaded class into event callback, so the reference is > >>> still live (maybe weak?) at this point. > >>> In our implementation there are no live references to the class objects > >>> in VM part of the class unloading. There is even an assertion that > >>> checks this in classloader.cpp:564. > >>> There are two ways to fix this. First one is to create our own > >>> implementation of class unloading event that wouldn't pass a reference > >>> to the class being unloaded, just its name. > > > > > > I am not very good with JVMTI semantics, but if it is OK to support an event > > with the name only, I would vote for this. It is least intrusive. > > I've looked at the agent code and it seems that the reference is > actually required. I didn't understand all of it, so possibly there is > still a workaround...
Is far as I understand reference to class is not required for JDWP agent. Current agent implementation uses reference first to get class signature second to fill eInfo structure which is used for event modifiers filtering. However modifiers allowed for CLASS_UNLOAD event do not require reference to the class. Thus we can implement TI extension event that will report only class signature for the class being unloaded. After that we should adapt JDWP agent to use this event.
