Top Description Methods
sun.jvm.hotspot.debugger

public Interface ThreadProxy

Known Direct Implementers
sun.jvm.hotspot.debugger.remote.RemoteThread, sun.jvm.hotspot.debugger.bsd.BsdThread, sun.jvm.hotspot.debugger.linux.LinuxThread, sun.jvm.hotspot.debugger.windbg.aarch64.WindbgAARCH64Thread, sun.jvm.hotspot.debugger.windbg.amd64.WindbgAMD64Thread, sun.jvm.hotspot.debugger.windbg.x86.WindbgX86Thread

This interface abstracts raw access to operating system-level threads. In a debugging environment these methods map to, for example, thread_db calls on Solaris (see /usr/include/thread_db.h) or the Win32 debugging API calls. In a runtime environment these might map directly to pthread calls.

Implementors of this interface must provide equals() and hashCode() methods which work properly regardless of how the ThreadProxy is obtained, in particular either through sun.jvm.hotspot.debugger.ThreadAccess or the thread list provided by sun.jvm.hotspot.debugger.cdbg.CDebugger. This allows matching up of the OS's notion of the thread list of the target process with any user-level lists that may be present (i.e., the JavaThread list in the HotSpot VM).

Implementors of this interface should also provide a toString() which converts the ThreadProxy to a value easily recognizable in the platform's debugger. (For example, on Solaris, "t@<id>".)

FIXME: had to be renamed from "Thread" to avoid numerous clashes with java.lang.Thread -- would be nice to pick a more consistent name with the rest of the system.

Method Summary

Modifier and TypeMethod and Description
public boolean
canSetContext()

Indicates whether calls to setContext() are valid.

public ThreadContext
getContext()

Retrieves the context for the given thread.

public void
setContext(ThreadContext context)

Sets the context for the given thread.

Method Detail

canSetContextback to summary
public boolean canSetContext() throws DebuggerException

Indicates whether calls to setContext() are valid.

getContextback to summary
public ThreadContext getContext() throws IllegalThreadStateException

Retrieves the context for the given thread. It is only valid to call this method if the thread is suspended (i.e., the process has not been resumed via ProcessControl); throws an IllegalThreadStateException if it is not.

setContextback to summary
public void setContext(ThreadContext context) throws IllegalThreadStateException, DebuggerException

Sets the context for the given thread. The passed ThreadContext must be a modified version of one returned from a previous call to getContext(). It is only valid to call this method if the thread is suspended (i.e., the process has not been resumed via ProcessControl); throws an IllegalThreadStateException if it is not. Throws a DebuggerException if the target process can not be modified, for example because it is a core file.