getting Class from ClassObjectReference

I have been trying to do get an object from a VM using JDI. What I am trying to do is this:

Get all classes using vm.allClasses().

This retuns a list of ReferenceTypes.

Now, using ReferenceType.classObject() I get a "ClassObjectReference".

But where do we go from here. How do I get the actual objects. If you read the description of ClassObjectReference, it says "An instance of java.lang.Class from the target VM". If this is so, then ClassObjectReference must be an extension of "Class". Unfortunately that is no the case.

Is this approach correct. Or should we go through the Thread way, using vm.allThreads() followed by getiing the Stack Frame and then searching for the object ?

Please Comment ?

[750 byte] By [hkagrawala] at [2007-9-29 13:26:05]
# 1
You would be better off fetching the Thread and StackFrame, then gettinga list of all variables visible from that point.Please take a look at the code snippets in this posting: http://forum.java.sun.com/thread.jsp?forum=47&thread=82998
debugging_teama at 2007-7-15 3:41:57 > top of Java-index,Archived Forums,Debugging Tools and Techniques...