The new home for Visual Studio documentation is Visual Studio 2017 Documentation on

The latest version of this topic can be found at IDebugProgram2.

This interface represents a program that is running in a process.

IDebugProgram2 : IUnknown  

The debug engine (DE) and a custom port supplier implement this interface to represent a program in a process. The session debug manager (SDM) also implements this interface to provide information to Attach.

The IDebugProgramCreateEvent2 event returns this interface for a new program. This interface is also used as a parameter for many methods on multiple interfaces.

The following table shows the methods of IDebugProgram2.

EnumThreadsEnumerates the threads that are running in this program.
GetNameGets the name of the program.
GetProcessGets the process that this program is running in.
TerminateTerminates this program.
AttachAttaches to this program.
CanDetachDetermines if a debug engine (DE) can detach from the program.
DetachDetaches the debugger from this program.
GetProgramIdGets a globally unique identifier for this program.
GetDebugPropertyGets program properties.
ExecuteContinues running this program from a stopped state. Any previous execution state is cleared.
ContinueContinues running this program from a stopped state. Any previous execution state is preserved.
StepPerforms a step.
CauseBreakRequests that this program stop execution the next time one of its threads runs code.
GetEngineInfoGets the name and identifier of the debug engine (DE) running this program.
EnumCodeContextsEnumerates the code contexts for a given position in a source file.
GetMemoryBytesGets the memory bytes for this program.
GetDisassemblyStreamGets the disassembly stream for this program or part of this program.
EnumModulesEnumerates the modules that this program has loaded and is executing.
GetENCUpdateGets the Edit and Continue (ENC) update for this program.

A custom debug engine does not implement this method (it should always return E_NOTIMPL).
EnumCodePathsEnumerates the code paths of this program.
WriteDumpWrites a dump to a file.

Header: msdbg.h

Namespace: Microsoft.VisualStudio.Debugger.Interop

Assembly: Microsoft.VisualStudio.Debugger.Interop.dll

A program is a thread container running in a particular run-time architecture, while a process is made up of one or more programs.

Core Interfaces