Implementing CreatePendingBreakpoint

The session debug manager (SDM) calls IDebugEngine2::CreatePendingBreakpoint with a breakpoint request, represented by the IDebugBreakpointRequest2 interface. The debug engine returns a pending breakpoint object, represented by the IDebugPendingBreakpoint2 interface, if the breakpoint can be created.

In TextInterpreter, the request for creating pending breakpoints is handled in the CProgram class and always succeeds.

To implement the CreatePendingBreakpoint method

  1. Open the Program.cpp file and insert the following bold line:

    #include "EventBase.h"
    #include "Breakpoint.h" 
    
  2. In the Program.cpp file, find CProgram::CreatePendingBreakpoint and replace the line //TODO: CREATE BREAKPOINT as well as the following return statement with the following:

        CComObject<CPendingBreakpoint> *pPending; 
        CComObject<CPendingBreakpoint>::CreateInstance(&pPending); 
        pPending->AddRef(); 
    
        pPending->Initialize(pBPRequest, m_spCallback, m_spEngine); 
        pPending->QueryInterface(ppPendingBP); 
    
        pPending->Release(); 
        return S_OK; 
    
  3. Build the project to make sure there are no errors.

See Also

Concepts

Creating a Pending Breakpoint