Launch-based attachment
Applies to: Visual Studio Visual 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
Launch-based attachment to a program is automatic. When the process hosting the program is launched by the SDM, launch-based attachment follows a path similar to that of the manual attachment method. For information, see Attach to the program.
The attaching process
The main difference is the sequence of events following the Attach call, as follows:
Send an IDebugEngineCreateEvent2 event object to the SDM. For details, see Send events.
Call the
IDebugProgram2::GetProgramId
method on the IDebugProgram2 interface passed to the Attach method.Send an IDebugProgramCreateEvent2 event object to notify the SDM that the local IDebugProgram2 object was created to represent the program to the DE.
Send an IDebugThreadCreateEvent2 event object to notify the SDM that a new thread is created for the process that launched.