Compartir a través de


Notify the port

Applies to: yesVisual Studio noVisual Studio for Mac

Note

This article applies to Visual Studio 2017. If you're looking for the latest Visual Studio documentation, see Visual Studio documentation. We recommend upgrading to the latest version of Visual Studio. Download it here

After launching a program, the port must be notified, as follows:

  1. When a port receives a new program node, it sends a program creation event back to the debug session. The event carries with it an interface that represents the program.

  2. The debug session queries the program for the identifier of a debug engine (DE) that can attach to.

  3. The debug session checks to see if the DE is on the list of allowable DEs for that program. The debug session gets this list from the solution's active program settings, originally passed to it by the debug package.

    The DE must be on the allowable list, or else the DE will not be attached to the program.

    Programmatically, when a port first receives a new program node, it creates an IDebugProgram2 interface to represent the program.

Note

This should not be confused with the IDebugProgram2 interface created later by the debug engine (DE).

The port sends an IDebugProgramCreateEvent2 program creation event back to the session debug manager (SDM) by means of a COM IConnectionPoint interface.

Note

This should not be confused with the IDebugProgramCreateEvent2 interface, which is sent later by the DE.

Along with the event interface itself, the port sends the IDebugPort2, IDebugProcess2, and IDebugProgram2 interfaces, which represent the port, process, and program, respectively. The SDM calls IDebugProgram2::GetEngineInfo to get the GUID of the DE that can debug the program. The GUID was originally obtained from the IDebugProgramNode2 interface.

The SDM checks to see if the DE is on the list of allowable DEs. The SDM gets this list from the solution's active program settings, originally passed to it by the debug package. The DE must be on the allowable list, or else it will not be attached to the program.

Once the identity of the DE is known, the SDM is ready to attach it to the program.

See also