Hello. .. You wrote:
> when I call ThreadReference.getValues(List a) I get a
> map
> of values (Value). Does these references represent for
> example the
> instantiated objects in this thread?
No. ThreadReference inherits getValue() and getValues() from ObjectReference,
and the ObjectReference we are dealing with here is the mirror of the thread object
over in the debugee.
Check the javadoc for the classes involved:
http://java.sun.com/j2se/1.4.2/docs/guide/jpda/jdi/com/sun/jdi/ThreadReference.html
Gets the value of multiple instance and/or static fields in this object.
The Fields must be valid for this ObjectReference; that is, they must
be from the mirrored object's class or a superclass of that class.
When you use ThreadReference.getValues() you will be accessing the internals
of Thread, such as the thread name, the priority, and so forth.
If you want to inspect the code the thread is running, as well as any heap or
local data the application has created, use
com.sun.jdi.ThreadReference.frame(int index)
to get the stack activation you are interested in. (Note that stack frame zero
is the most recent or 'current' frame.)
From the StackFrame you can look up information relative to the application
code being run by the ThreadReference, which is probably more interesting
than the internals of the Thread itself:
http://java.sun.com/j2se/1.4.2/docs/guide/jpda/jdi/com/sun/jdi/StackFrame.html
If you want to list the source code at this point, you can get the com.sun.jdi.Location .
from the StackFrame, and from there get the code index, name of the source file, etc.
The com.sun.jdi.StackFrame.thisObject() method will return the value of 'this' for
the current frame. 'this' is the ObjectReference you probably want to explore further.
You can get a list of local variables accessible from this point of exection using
com.sun.jdi.StackFrame.visibleVariables().