Eclipse Platform
2.0

org.eclipse.debug.core.model
Interface IThread

All Superinterfaces:
IAdaptable, IDebugElement, IStep, ISuspendResume, ITerminate

public interface IThread
extends IDebugElement, ISuspendResume, IStep, ITerminate

A thread is a sequential flow of execution in a debug target. A thread contains stack frames. Stack frames are only available when the thread is suspended, and are returned in top-down order. Minimally, a thread supports the following:

Clients may implement this interface.

See Also:
ISuspendResume, IStep, ITerminate, IStackFrame

Method Summary
 IBreakpoint[] getBreakpoints()
          Returns the breakpoints that caused this thread to suspend, or an empty collection if this thread is not suspended or was not suspended by a breakpoint.
 String getName()
          Returns the name of this thread.
 int getPriority()
          Returns the priority of this thread.
 IStackFrame[] getStackFrames()
          Returns the stack frames contained in this thread.
 IStackFrame getTopStackFrame()
          Returns the top stack frame or null if there is currently no top stack frame.
 boolean hasStackFrames()
          Returns whether this thread currently contains any stack frames.
 
Methods inherited from interface org.eclipse.debug.core.model.IDebugElement
getDebugTarget, getLaunch, getModelIdentifier
 
Methods inherited from interface org.eclipse.core.runtime.IAdaptable
getAdapter
 
Methods inherited from interface org.eclipse.debug.core.model.ISuspendResume
canResume, canSuspend, isSuspended, resume, suspend
 
Methods inherited from interface org.eclipse.debug.core.model.IStep
canStepInto, canStepOver, canStepReturn, isStepping, stepInto, stepOver, stepReturn
 
Methods inherited from interface org.eclipse.debug.core.model.ITerminate
canTerminate, isTerminated, terminate
 

Method Detail

getStackFrames

public IStackFrame[] getStackFrames()
                             throws DebugException
Returns the stack frames contained in this thread. An empty collection is returned if this thread contains no stack frames, or is not currently suspended. Stack frames are returned in top down order.

Returns:
a collection of stack frames
Throws:
DebugException - if this method fails. Reasons include:
  • Failure communicating with the VM. The DebugException's status code contains the underlying exception responsible for the failure.
Since:
2.0

hasStackFrames

public boolean hasStackFrames()
                       throws DebugException
Returns whether this thread currently contains any stack frames.

Returns:
whether this thread currently contains any stack frames
Throws:
DebugException - if this method fails. Reasons include:
  • Failure communicating with the debug target. The DebugException's status code contains the underlying exception responsible for the failure.
Since:
2.0

getPriority

public int getPriority()
                throws DebugException
Returns the priority of this thread. The meaning of this number is operating-system dependent.

Returns:
thread priority
Throws:
DebugException - if this method fails. Reasons include:
  • Failure communicating with the VM. The DebugException's status code contains the underlying exception responsible for the failure.

getTopStackFrame

public IStackFrame getTopStackFrame()
                             throws DebugException
Returns the top stack frame or null if there is currently no top stack frame.

Returns:
the top stack frame, or null if none
Throws:
DebugException - if this method fails. Reasons include:
  • Failure communicating with the VM. The DebugException's status code contains the underlying exception responsible for the failure.

getName

public String getName()
               throws DebugException
Returns the name of this thread. Name format is debug model specific, and should be specified by a debug model.

Returns:
this thread's name
Throws:
DebugException - if this method fails. Reasons include:
  • Failure communicating with the VM. The DebugException's status code contains the underlying exception responsible for the failure.

getBreakpoints

public IBreakpoint[] getBreakpoints()
Returns the breakpoints that caused this thread to suspend, or an empty collection if this thread is not suspended or was not suspended by a breakpoint. Usually a single breakpoint will be returned, but this collection can contain more than one breakpoint if two breakpoints are at the same location in a program.

Returns:
the collection of breakpoints that caused this thread to suspend

Eclipse Platform
2.0

Copyright (c) IBM Corp. and others 2000, 2002. All Rights Reserved.