Launch the debugger

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

Launching the debugger requires sending the correct sequence of methods and events with their proper attributes.

Sequences of methods and events

  1. The session debug manager (SDM) is called by choosing the Debug menu, and then choosing Start. For more information, see Launch a program.

  2. The SDM calls OnAttach method.

  3. Based on the debug engine (DE) process model, the IDebugProgramNodeAttach2::OnAttach method returns one of the following methods, which determines what happens next.

    If S_FALSE returns, the debug engine (DE) is to be loaded in process of the virtual machine.

    -or-

    If S_OK returns, the DE is to be loaded in-process of the SDM. The SDM then performs the following tasks:

    1. Calls GetEngineInfo to get the engine information of the DE.

    2. Co-creates the DE.

    3. Calls Attach.

  4. The DE sends an IDebugEngineCreateEvent2 to the SDM with an EVENT_SYNC attribute.

  5. The DE sends an IDebugProgramCreateEvent2 to the SDM with an EVENT_SYNC attribute.

  6. The DE sends an IDebugThreadCreateEvent2 to the SDM with an EVENT_SYNC attribute.

  7. The DE sends an IDebugLoadCompleteEvent2 to the SDM with an EVENT_SYNC attribute.

  8. The DE sends an IDebugEntryPointEvent2 to the SDM with an EVENT_SYNC attribute.

See also