Compartilhar via


IDebugThread2

This interface represents a thread running in a program.

IDebugThread2 : IUnknown

Notes for Implementers

The debug engine (DE) implements this interface to represent a thread of execution in a single program.

Notes for Callers

Call IDebugStackFrame2::GetThread to obtain this interface representing the currently active thread.

This interface is also used in creating a breakpoint request (see BP_REQUEST_INFO).

This interface is also returned when resolving a bound or error breakpoint (see BP_RESOLUTION_INFO and BP_ERROR_RESOLUTION_INFO).

Methods in Vtable Order

The following table shows the methods of IDebugThread2.

Method

Description

IDebugThread2::EnumFrameInfo

Retrieves a list of the stack frames for this thread.

IDebugThread2::GetName

Gets the name of the thread.

IDebugThread2::SetThreadName

Sets the name of the thread.

IDebugThread2::GetProgram

Gets the program in which a thread is running.

IDebugThread2::CanSetNextStatement

Determines whether the next statement can be set to the given stack frame and code context.

IDebugThread2::SetNextStatement

Sets the next statement to the given stack frame and code context.

IDebugThread2::GetThreadId

Gets the system thread identifier.

IDebugThread2::Suspend

Suspends a thread.

IDebugThread2::Resume

Resumes a thread.

IDebugThread2::GetThreadProperties

Gets properties that describe a thread.

IDebugThread2::GetLogicalThread

Gets the logical thread associated with this physical thread.

Remarks

Because a single physical thread can run in multiple programs, more than one IDebugThread2 from more than one program can represent the same physical thread.

When a breakpoint or exception occurs, an event is sent by calling IDebugEventCallback2::Event. One of the arguments to this method is an IDebugThread2 interface representing the current thread. IDebugThread2::EnumFrameInfo is used to obtain the IDebugStackFrame2 interface for the current stack frame.

Requirements

Header: msdbg.h

Namespace: Microsoft.VisualStudio.Debugger.Interop

Assembly: Microsoft.VisualStudio.Debugger.Interop.dll

See Also

Reference

IDebugEventCallback2::Event

IDebugStackFrame2::GetThread

BP_REQUEST_INFO

BP_RESOLUTION_INFO

BP_ERROR_RESOLUTION_INFO

Concepts

Core Interfaces