Share via


Launching the Debugger

Note

This article applies to Visual Studio 2015. 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. See Launching a Program for more information.

  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 is returned, the debug engine (DE) is to be loaded in process of the virtual machine.

    -or-

    If S_OK is returned, 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

Calling Debugger Events
Launching a Program