int IDebugPendingBreakpoint2.Bind()
{
try
{
if (CanBind())
{
AD7BoundBreakpoint xBBP = null;
// Visual Studio returns a start position that is one less than it actually is
xBBP = new AD7BoundBreakpoint(m_engine, m_bpRequestInfo, this);
if (VSNDK.Package.ControlDebugEngine.isDebugEngineRunning == false)
{
return VSConstants.S_FALSE;
}
if ((xBBP == null) || (xBBP.GDB_ID == 0))
{
return VSConstants.S_FALSE;
}
// Set the enabled state of the bound breakpoint based on the pending breakpoint's enabled state
((IDebugBoundBreakpoint2)xBBP).Enable(Convert.ToInt32(m_enabled));
m_boundBreakpoints.Add(xBBP);
return VSConstants.S_OK;
}
else
{
// The breakpoint could not be bound. This may occur for many reasons such as an invalid location, an invalid
// expression, etc... The VSNDK debug engine does not support this, but a real world engine will want to send an
// instance of IDebugBreakpointErrorEvent2 to the UI and return a valid instance of IDebugErrorBreakpoint2 from
// IDebugPendingBreakpoint2::EnumErrorBreakpoints. The debugger will then display information about why the
// breakpoint did not bind to the user.
return VSConstants.S_FALSE;
}
}
catch (Exception e)
{
return EngineUtils.UnexpectedException(e);
}
}