Пример #1
0
        private bool CanBind()
        {
            // The sample engine only supports breakpoints on a file and line number or function name. No other types of breakpoints are supported.
            if (_deleted ||
                (_bpRequestInfo.bpLocation.bpLocationType != (uint)enum_BP_LOCATION_TYPE.BPLT_CODE_FILE_LINE &&
                 _bpRequestInfo.bpLocation.bpLocationType != (uint)enum_BP_LOCATION_TYPE.BPLT_CODE_FUNC_OFFSET))
            {
                _BPError = new AD7ErrorBreakpoint(this, ResourceStrings.UnsupportedBreakpoint, enum_BP_ERROR_TYPE.BPET_GENERAL_ERROR);
                return(false);
            }
            if ((_bpRequestInfo.dwFields & enum_BPREQI_FIELDS.BPREQI_CONDITION) != 0)
            {
                if (!VerifyCondition(_bpRequestInfo.bpCondition))
                {
                    _BPError = new AD7ErrorBreakpoint(this, ResourceStrings.UnsupportedConditionalBreakpoint, enum_BP_ERROR_TYPE.BPET_GENERAL_ERROR);
                    return(false);
                }
            }
            if ((_bpRequestInfo.dwFields & enum_BPREQI_FIELDS.BPREQI_PASSCOUNT) != 0)
            {
                _BPError = new AD7ErrorBreakpoint(this, ResourceStrings.UnsupportedPassCountBreakpoint, enum_BP_ERROR_TYPE.BPET_GENERAL_ERROR);
                return(false);
            }

            return(true);
        }
Пример #2
0
        private bool CanBind()
        {
            // The sample engine only supports breakpoints on a file and line number or function name. No other types of breakpoints are supported.
            if (_deleted ||
                (_bpRequestInfo.bpLocation.bpLocationType != (uint)enum_BP_LOCATION_TYPE.BPLT_CODE_FILE_LINE
                && _bpRequestInfo.bpLocation.bpLocationType != (uint)enum_BP_LOCATION_TYPE.BPLT_CODE_FUNC_OFFSET))
            {
                _BPError = new AD7ErrorBreakpoint(this, ResourceStrings.UnsupportedBreakpoint, enum_BP_ERROR_TYPE.BPET_GENERAL_ERROR);
                return false;
            }
            if ((_bpRequestInfo.dwFields & enum_BPREQI_FIELDS.BPREQI_CONDITION) != 0)
            {
                if (!VerifyCondition(_bpRequestInfo.bpCondition))
                {
                    _BPError = new AD7ErrorBreakpoint(this, ResourceStrings.UnsupportedConditionalBreakpoint, enum_BP_ERROR_TYPE.BPET_GENERAL_ERROR);
                    return false;
                }
            }
            if ((_bpRequestInfo.dwFields & enum_BPREQI_FIELDS.BPREQI_PASSCOUNT) != 0)
            {
                _BPError = new AD7ErrorBreakpoint(this, ResourceStrings.UnsupportedPassCountBreakpoint, enum_BP_ERROR_TYPE.BPET_GENERAL_ERROR);
                return false;
            }

            return true;
        }
Пример #3
0
        private int EnableUsingBindAndDelete(int fEnable)
        {
            bool newValue = fEnable == 0 ? false : true;

            if (_enabled == newValue)
            {
                return(Constants.S_OK);
            }

            _enabled = newValue;

            if (_enabled)
            {
                return(BindWithTimeout());
            }
            else
            {
                lock (_boundBreakpoints)
                {
                    foreach (var boundBp in _boundBreakpoints)
                    {
                        _engine.Callback.OnBreakpointUnbound(boundBp, enum_BP_UNBOUND_REASON.BPUR_UNKNOWN);
                    }
                    (this as IDebugPendingBreakpoint2).Delete();
                    _boundBreakpoints.Clear();
                    _BPError = null;
                    // this pending breakpoint is not actually deleted, just disabled, so override this flag
                    _deleted = false;
                }
            }

            return(Constants.S_OK);
        }
Пример #4
0
        // Binds this pending breakpoint to one or more code locations.
        int IDebugPendingBreakpoint2.Bind()
        {
            try
            {
                if (CanBind())
                {
                    Task bindTask = null;

                    _engine.DebuggedProcess.WorkerThread.RunOperation(() =>
                    {
                        bindTask = _engine.DebuggedProcess.AddInternalBreakAction(this.BindAsync);
                    });

                    bindTask.Wait(250); //wait a quarter of a second

                    if (!bindTask.IsCompleted)
                    {
                        //send a low severity warning bp. This will allow the UI to respond quickly, and if the mi debugger doesn't end up binding, this warning will get
                        //replaced by the real mi debugger error text
                        _BPError = new AD7ErrorBreakpoint(this, ResourceStrings.LongBind, enum_BP_ERROR_TYPE.BPET_SEV_LOW | enum_BP_ERROR_TYPE.BPET_TYPE_WARNING);
                        _engine.Callback.OnBreakpointError(_BPError);
                        return(Constants.S_FALSE);
                    }
                    else
                    {
                        return(Constants.S_OK);
                    }
                }
                else
                {
                    // The breakpoint could not be bound. This may occur for many reasons such as an invalid location, an invalid expression, etc...
                    _engine.Callback.OnBreakpointError(_BPError);
                    return(Constants.S_FALSE);
                }
            }
            catch (MIException e)
            {
                return(e.HResult);
            }
            catch (AggregateException e)
            {
                if (e.GetBaseException() is InvalidCoreDumpOperationException)
                {
                    return(AD7_HRESULT.E_CRASHDUMP_UNSUPPORTED);
                }
                else
                {
                    return(EngineUtils.UnexpectedException(e));
                }
            }
            catch (InvalidCoreDumpOperationException)
            {
                return(AD7_HRESULT.E_CRASHDUMP_UNSUPPORTED);
            }
            catch (Exception e)
            {
                return(EngineUtils.UnexpectedException(e));
            }
        }
Пример #5
0
        public void SetError(AD7ErrorBreakpoint bpError, bool sendEvent = false)
        {
            _BPError = bpError;

            if (sendEvent)
            {
                _engine.Callback.OnBreakpointError(bpError);
            }
        }
Пример #6
0
 // The sample engine does not support pass counts on breakpoints.
 int IDebugPendingBreakpoint2.SetPassCount(BP_PASSCOUNT bpPassCount)
 {
     if (bpPassCount.stylePassCount != enum_BP_PASSCOUNT_STYLE.BP_PASSCOUNT_NONE)
     {
         _BPError = new AD7ErrorBreakpoint(this, ResourceStrings.UnsupportedPassCountBreakpoint, enum_BP_ERROR_TYPE.BPET_GENERAL_ERROR);
         _engine.Callback.OnBreakpointError(_BPError);
         return(Constants.E_FAIL);
     }
     return(Constants.S_OK);
 }
Пример #7
0
        internal async Task BindAsync()
        {
            if (CanBind())
            {
                string          documentName  = null;
                TEXT_POSITION[] startPosition = new TEXT_POSITION[1];
                TEXT_POSITION[] endPosition   = new TEXT_POSITION[1];
                string          condition     = null;

                lock (_boundBreakpoints)
                {
                    if (_bp != null)   // already bound
                    {
                        Debug.Fail("Breakpoint already bound");
                        return;
                    }
                    IDebugDocumentPosition2 docPosition = HostMarshal.GetDocumentPositionForIntPtr(_bpRequestInfo.bpLocation.unionmember2);

                    // Get the name of the document that the breakpoint was put in
                    EngineUtils.CheckOk(docPosition.GetFileName(out documentName));

                    // Get the location in the document that the breakpoint is in.
                    EngineUtils.CheckOk(docPosition.GetRange(startPosition, endPosition));
                    if ((_bpRequestInfo.dwFields & enum_BPREQI_FIELDS.BPREQI_CONDITION) != 0 &&
                        _bpRequestInfo.bpCondition.styleCondition == enum_BP_COND_STYLE.BP_COND_WHEN_TRUE)
                    {
                        condition = _bpRequestInfo.bpCondition.bstrCondition;
                    }
                }

                // Bind all breakpoints that match this source and line number.
                PendingBreakpoint.BindResult bindResult = await PendingBreakpoint.Bind(documentName, startPosition[0].dwLine + 1, startPosition[0].dwColumn, _engine.DebuggedProcess, condition, this);

                lock (_boundBreakpoints)
                {
                    if (bindResult.PendingBreakpoint != null)
                    {
                        _bp = bindResult.PendingBreakpoint;    // an MI breakpoint object exists: TODO: lock?
                    }
                    if (bindResult.BoundBreakpoints == null || bindResult.BoundBreakpoints.Count == 0)
                    {
                        _BPError = new AD7ErrorBreakpoint(this, bindResult.ErrorMessage);
                        _engine.Callback.OnBreakpointError(_BPError);
                    }
                    else
                    {
                        Debug.Assert(_bp != null);
                        foreach (BoundBreakpoint bp in bindResult.BoundBreakpoints)
                        {
                            AddBoundBreakpoint(bp);
                        }
                    }
                }
            }
        }
Пример #8
0
        public AD7PendingBreakpoint(IDebugBreakpointRequest2 pBPRequest, AD7Engine engine, BreakpointManager bpManager)
        {
            _pBPRequest = pBPRequest;
            BP_REQUEST_INFO[] requestInfo = new BP_REQUEST_INFO[1];
            EngineUtils.CheckOk(_pBPRequest.GetRequestInfo(enum_BPREQI_FIELDS.BPREQI_BPLOCATION | enum_BPREQI_FIELDS.BPREQI_CONDITION | enum_BPREQI_FIELDS.BPREQI_PASSCOUNT, requestInfo));
            _bpRequestInfo = requestInfo[0];

            _engine = engine;
            _bpManager = bpManager;
            _boundBreakpoints = new List<AD7BoundBreakpoint>();

            _enabled = true;
            _deleted = false;
            _pendingDelete = false;

            _bp = null;    // no underlying breakpoint created yet
            _BPError = null;
        }
Пример #9
0
        public AD7PendingBreakpoint(IDebugBreakpointRequest2 pBPRequest, AD7Engine engine, BreakpointManager bpManager)
        {
            _pBPRequest = pBPRequest;
            BP_REQUEST_INFO[] requestInfo = new BP_REQUEST_INFO[1];
            EngineUtils.CheckOk(_pBPRequest.GetRequestInfo(enum_BPREQI_FIELDS.BPREQI_BPLOCATION | enum_BPREQI_FIELDS.BPREQI_CONDITION | enum_BPREQI_FIELDS.BPREQI_PASSCOUNT, requestInfo));
            _bpRequestInfo = requestInfo[0];

            _engine           = engine;
            _bpManager        = bpManager;
            _boundBreakpoints = new List <AD7BoundBreakpoint>();

            _enabled       = true;
            _deleted       = false;
            _pendingDelete = false;

            _bp      = null; // no underlying breakpoint created yet
            _BPError = null;
        }
Пример #10
0
        int IDebugPendingBreakpoint2.SetCondition(BP_CONDITION bpCondition)
        {
            PendingBreakpoint bp = null;

            lock (_boundBreakpoints)
            {
                if (!VerifyCondition(bpCondition))
                {
                    _BPError = new AD7ErrorBreakpoint(this, ResourceStrings.UnsupportedConditionalBreakpoint, enum_BP_ERROR_TYPE.BPET_GENERAL_ERROR);
                    _engine.Callback.OnBreakpointError(_BPError);
                    return(Constants.E_FAIL);
                }
                if ((_bpRequestInfo.dwFields & enum_BPREQI_FIELDS.BPREQI_CONDITION) != 0 &&
                    _bpRequestInfo.bpCondition.styleCondition == bpCondition.styleCondition &&
                    _bpRequestInfo.bpCondition.bstrCondition == bpCondition.bstrCondition)
                {
                    return(Constants.S_OK);  // this condition was already set
                }
                _bpRequestInfo.bpCondition = bpCondition;
                _bpRequestInfo.dwFields   |= enum_BPREQI_FIELDS.BPREQI_CONDITION;
                if (_bp != null)
                {
                    bp = _bp;
                }
            }
            if (bp != null)
            {
                _engine.DebuggedProcess.WorkerThread.RunOperation(() =>
                {
                    _engine.DebuggedProcess.AddInternalBreakAction(
                        () => bp.SetConditionAsync(bpCondition.bstrCondition, _engine.DebuggedProcess)
                        );
                });
            }
            return(Constants.S_OK);
        }
Пример #11
0
 int IDebugPendingBreakpoint2.SetCondition(BP_CONDITION bpCondition)
 {
     PendingBreakpoint bp = null;
     lock (_boundBreakpoints)
     {
         if (!VerifyCondition(bpCondition) || IsDataBreakpoint)
         {
             _BPError = new AD7ErrorBreakpoint(this, ResourceStrings.UnsupportedConditionalBreakpoint, enum_BP_ERROR_TYPE.BPET_GENERAL_ERROR);
             _engine.Callback.OnBreakpointError(_BPError);
             return Constants.E_FAIL;
         }
         if ((_bpRequestInfo.dwFields & enum_BPREQI_FIELDS.BPREQI_CONDITION) != 0
             && _bpRequestInfo.bpCondition.styleCondition == bpCondition.styleCondition
             && _bpRequestInfo.bpCondition.bstrCondition == bpCondition.bstrCondition)
         {
             return Constants.S_OK;  // this condition was already set
         }
         _bpRequestInfo.bpCondition = bpCondition;
         _bpRequestInfo.dwFields |= enum_BPREQI_FIELDS.BPREQI_CONDITION;
         if (_bp != null)
         {
             bp = _bp;
         }
     }
     if (bp != null)
     {
         _engine.DebuggedProcess.WorkerThread.RunOperation(() =>
         {
             _engine.DebuggedProcess.AddInternalBreakAction(
                 () => bp.SetConditionAsync(bpCondition.bstrCondition, _engine.DebuggedProcess)
                     );
         });
     }
     return Constants.S_OK;
 }
Пример #12
0
        public void SetError(AD7ErrorBreakpoint bpError, bool sendEvent = false)
        {
            _BPError = bpError;

            if (sendEvent)
            {
                _engine.Callback.OnBreakpointError(bpError);
            }
        }
Пример #13
0
 public AD7BreakpointErrorEvent(AD7ErrorBreakpoint error)
 {
     _error = error;
 }
Пример #14
0
        internal async Task BindAsync()
        {
            if (CanBind())
            {
                string documentName = null;
                string functionName = null;
                TEXT_POSITION[] startPosition = new TEXT_POSITION[1];
                TEXT_POSITION[] endPosition = new TEXT_POSITION[1];
                string condition = null;

                lock (_boundBreakpoints)
                {
                    if (_bp != null)   // already bound
                    {
                        Debug.Fail("Breakpoint already bound");
                        return;
                    }
                    if ((_bpRequestInfo.dwFields & enum_BPREQI_FIELDS.BPREQI_BPLOCATION) != 0)
                    {
                        if (_bpRequestInfo.bpLocation.bpLocationType == (uint)enum_BP_LOCATION_TYPE.BPLT_CODE_FUNC_OFFSET)
                        {
                            IDebugFunctionPosition2 functionPosition = HostMarshal.GetDebugFunctionPositionForIntPtr(_bpRequestInfo.bpLocation.unionmember2);
                            EngineUtils.CheckOk(functionPosition.GetFunctionName(out functionName));
                        }
                        else if (_bpRequestInfo.bpLocation.bpLocationType == (uint)enum_BP_LOCATION_TYPE.BPLT_CODE_FILE_LINE)
                        {
                            IDebugDocumentPosition2 docPosition = HostMarshal.GetDocumentPositionForIntPtr(_bpRequestInfo.bpLocation.unionmember2);

                            // Get the name of the document that the breakpoint was put in
                            EngineUtils.CheckOk(docPosition.GetFileName(out documentName));

                            // Get the location in the document that the breakpoint is in.
                            EngineUtils.CheckOk(docPosition.GetRange(startPosition, endPosition));
                        }
                    }
                    if ((_bpRequestInfo.dwFields & enum_BPREQI_FIELDS.BPREQI_CONDITION) != 0
                        && _bpRequestInfo.bpCondition.styleCondition == enum_BP_COND_STYLE.BP_COND_WHEN_TRUE)
                    {
                        condition = _bpRequestInfo.bpCondition.bstrCondition;
                    }
                }
                PendingBreakpoint.BindResult bindResult;
                // Bind all breakpoints that match this source and line number.
                if (documentName != null)
                {
                    bindResult = await PendingBreakpoint.Bind(documentName, startPosition[0].dwLine + 1, startPosition[0].dwColumn, _engine.DebuggedProcess, condition, this);
                }
                else
                {
                    bindResult = await PendingBreakpoint.Bind(functionName, _engine.DebuggedProcess, condition, this);
                }

                lock (_boundBreakpoints)
                {
                    if (bindResult.PendingBreakpoint != null)
                    {
                        _bp = bindResult.PendingBreakpoint;    // an MI breakpoint object exists: TODO: lock?
                    }
                    if (bindResult.BoundBreakpoints == null || bindResult.BoundBreakpoints.Count == 0)
                    {
                        _BPError = new AD7ErrorBreakpoint(this, bindResult.ErrorMessage);
                        _engine.Callback.OnBreakpointError(_BPError);
                    }
                    else
                    {
                        Debug.Assert(_bp != null);
                        foreach (BoundBreakpoint bp in bindResult.BoundBreakpoints)
                        {
                            AddBoundBreakpoint(bp);
                        }
                    }
                }
            }
        }
Пример #15
0
 public AD7BreakpointErrorEvent(AD7ErrorBreakpoint error)
 {
     _error = error;
 }
Пример #16
0
        // Engines notify the SDM that a pending breakpoint failed to bind through the breakpoint error event
        public void OnBreakpointError(AD7ErrorBreakpoint bperr)
        {
            AD7BreakpointErrorEvent eventObject = new AD7BreakpointErrorEvent(bperr);

            Send(eventObject, AD7BreakpointErrorEvent.IID, null);
        }
Пример #17
0
 // Engines notify the SDM that a pending breakpoint failed to bind through the breakpoint error event
 public void OnBreakpointError(AD7ErrorBreakpoint bperr)
 {
     AD7BreakpointErrorEvent eventObject = new AD7BreakpointErrorEvent(bperr);
     Send(eventObject, AD7BreakpointErrorEvent.IID, null);
 }
Пример #18
0
 // The sample engine does not support pass counts on breakpoints.
 int IDebugPendingBreakpoint2.SetPassCount(BP_PASSCOUNT bpPassCount)
 {
     if (bpPassCount.stylePassCount != enum_BP_PASSCOUNT_STYLE.BP_PASSCOUNT_NONE)
     {
         _BPError = new AD7ErrorBreakpoint(this, ResourceStrings.UnsupportedPassCountBreakpoint, enum_BP_ERROR_TYPE.BPET_GENERAL_ERROR);
         _engine.Callback.OnBreakpointError(_BPError);
         return Constants.E_FAIL;
     }
     return Constants.S_OK;
 }
Пример #19
0
        internal async Task BindAsync()
        {
            if (CanBind())
            {
                string documentName = null;
                string functionName = null;
                TEXT_POSITION[] startPosition = new TEXT_POSITION[1];
                TEXT_POSITION[] endPosition = new TEXT_POSITION[1];
                string condition = null;
                string address = null;
                ulong codeAddress = 0;
                uint size = 0;

                lock (_boundBreakpoints)
                {
                    if (_bp != null)   // already bound
                    {
                        Debug.Fail("Breakpoint already bound");
                        return;
                    }
                    if ((_bpRequestInfo.dwFields & enum_BPREQI_FIELDS.BPREQI_CONDITION) != 0
                        && _bpRequestInfo.bpCondition.styleCondition == enum_BP_COND_STYLE.BP_COND_WHEN_TRUE)
                    {
                        condition = _bpRequestInfo.bpCondition.bstrCondition;
                    }
                    if ((_bpRequestInfo.dwFields & enum_BPREQI_FIELDS.BPREQI_BPLOCATION) != 0)
                    {
                        switch ((enum_BP_LOCATION_TYPE)_bpRequestInfo.bpLocation.bpLocationType)
                        {
                            case enum_BP_LOCATION_TYPE.BPLT_CODE_FUNC_OFFSET:
                                {
                                    IDebugFunctionPosition2 functionPosition = HostMarshal.GetDebugFunctionPositionForIntPtr(_bpRequestInfo.bpLocation.unionmember2);
                                    EngineUtils.CheckOk(functionPosition.GetFunctionName(out functionName));
                                    break;
                                }
                            case enum_BP_LOCATION_TYPE.BPLT_CODE_CONTEXT:
                                {
                                    IDebugCodeContext2 codePosition = HostMarshal.GetDebugCodeContextForIntPtr(_bpRequestInfo.bpLocation.unionmember1);
                                    if (!(codePosition is AD7MemoryAddress))
                                    {
                                        goto default;   // context is not from this engine
                                    }
                                    codeAddress = ((AD7MemoryAddress)codePosition).Address;
                                    break;
                                }
                            case enum_BP_LOCATION_TYPE.BPLT_CODE_FILE_LINE:
                                {
                                    IDebugDocumentPosition2 docPosition = HostMarshal.GetDocumentPositionForIntPtr(_bpRequestInfo.bpLocation.unionmember2);

                                    // Get the name of the document that the breakpoint was put in
                                    EngineUtils.CheckOk(docPosition.GetFileName(out documentName));

                                    // Get the location in the document that the breakpoint is in.
                                    EngineUtils.CheckOk(docPosition.GetRange(startPosition, endPosition));
                                    break;
                                }
                            case enum_BP_LOCATION_TYPE.BPLT_DATA_STRING:
                                {
                                    address = HostMarshal.GetDataBreakpointStringForIntPtr(_bpRequestInfo.bpLocation.unionmember3);
                                    size = (uint)_bpRequestInfo.bpLocation.unionmember4;
                                    if (condition != null)
                                    {
                                        goto default;   // mi has no conditions on watchpoints
                                    }
                                    break;
                                }
                            default:
                                {
                                    _BPError = new AD7ErrorBreakpoint(this, ResourceStrings.UnsupportedBreakpoint);
                                    _engine.Callback.OnBreakpointError(_BPError);
                                    return;
                                }
                        }
                    }
                }
                PendingBreakpoint.BindResult bindResult;
                // Bind all breakpoints that match this source and line number.
                if (documentName != null)
                {
                    bindResult = await PendingBreakpoint.Bind(documentName, startPosition[0].dwLine + 1, startPosition[0].dwColumn, _engine.DebuggedProcess, condition, this);
                }
                else if (functionName != null)
                {
                    bindResult = await PendingBreakpoint.Bind(functionName, _engine.DebuggedProcess, condition, this);
                }
                else if (codeAddress != 0)
                {
                    bindResult = await PendingBreakpoint.Bind(codeAddress, _engine.DebuggedProcess, condition, this);
                }
                else
                {
                    bindResult = await PendingBreakpoint.Bind(address, size, _engine.DebuggedProcess, condition, this);
                }

                lock (_boundBreakpoints)
                {
                    if (bindResult.PendingBreakpoint != null)
                    {
                        _bp = bindResult.PendingBreakpoint;    // an MI breakpoint object exists: TODO: lock?
                    }
                    if (bindResult.BoundBreakpoints == null || bindResult.BoundBreakpoints.Count == 0)
                    {
                        _BPError = new AD7ErrorBreakpoint(this, bindResult.ErrorMessage);
                        _engine.Callback.OnBreakpointError(_BPError);
                    }
                    else
                    {
                        Debug.Assert(_bp != null);
                        foreach (BoundBreakpoint bp in bindResult.BoundBreakpoints)
                        {
                            AddBoundBreakpoint(bp);
                        }
                    }
                }
            }
        }
Пример #20
0
        // Binds this pending breakpoint to one or more code locations.
        int IDebugPendingBreakpoint2.Bind()
        {
            try
            {
                if (CanBind())
                {
                    Task bindTask = null;

                    _engine.DebuggedProcess.WorkerThread.RunOperation(() =>
                    {
                        bindTask = _engine.DebuggedProcess.AddInternalBreakAction(this.BindAsync);
                    });

                    bindTask.Wait(250); //wait a quarter of a second

                    if (!bindTask.IsCompleted)
                    {
                        //send a low severity warning bp. This will allow the UI to respond quickly, and if the mi debugger doesn't end up binding, this warning will get 
                        //replaced by the real mi debugger error text
                        _BPError = new AD7ErrorBreakpoint(this, ResourceStrings.LongBind, enum_BP_ERROR_TYPE.BPET_SEV_LOW | enum_BP_ERROR_TYPE.BPET_TYPE_WARNING);
                        _engine.Callback.OnBreakpointError(_BPError);
                        return Constants.S_FALSE;
                    }
                    else
                    {
                        return Constants.S_OK;
                    }
                }
                else
                {
                    // The breakpoint could not be bound. This may occur for many reasons such as an invalid location, an invalid expression, etc...
                    _engine.Callback.OnBreakpointError(_BPError);
                    return Constants.S_FALSE;
                }
            }
            catch (MIException e)
            {
                return e.HResult;
            }
            catch (AggregateException e)
            {
                if (e.GetBaseException() is InvalidCoreDumpOperationException)
                    return AD7_HRESULT.E_CRASHDUMP_UNSUPPORTED;
                else
                    return EngineUtils.UnexpectedException(e);
            }
            catch (InvalidCoreDumpOperationException)
            {
                return AD7_HRESULT.E_CRASHDUMP_UNSUPPORTED;
            }
            catch (Exception e)
            {
                return EngineUtils.UnexpectedException(e);
            }
        }