예제 #1
0
 // Called by bound breakpoints when they are being deleted.
 public void OnBoundBreakpointDeleted(AD7BoundBreakpoint boundBreakpoint)
 {
     lock (_boundBreakpoints)
     {
         _boundBreakpoints.Remove(boundBreakpoint);
     }
 }
예제 #2
0
        public void RemoteDisable(AD7BoundBreakpoint aBBP)
        {
            mActiveBPs[aBBP.RemoteID] = null;

            int index = mEngine.mProcess.INT3sSet.FindIndex(x => x.Key == aBBP.mAddress);

            mEngine.mProcess.INT3sSet.RemoveAt(index);
            mDbgConnector.DeleteBreakpoint(aBBP.RemoteID);
        }
예제 #3
0
        // Engines notify the debugger that a breakpoint has bound through the breakpoint bound event.
        public void OnBreakpointBound(object objBoundBreakpoint, uint address)
        {
            AD7BoundBreakpoint       boundBreakpoint = (AD7BoundBreakpoint)objBoundBreakpoint;
            IDebugPendingBreakpoint2 pendingBreakpoint;

            ((IDebugBoundBreakpoint2)boundBreakpoint).GetPendingBreakpoint(out pendingBreakpoint);

            AD7BreakpointBoundEvent eventObject = new AD7BreakpointBoundEvent((AD7PendingBreakpoint)pendingBreakpoint, boundBreakpoint);

            Send(eventObject, AD7BreakpointBoundEvent.IID, null);
        }
예제 #4
0
 // Creates an entry and remotely enables the breakpoint in the debug stub
 public int RemoteEnable(AD7BoundBreakpoint aBBP)
 {
     for (int xID = 0; xID < MaxBP; xID++)
     {
         if (mActiveBPs[xID] == null)
         {
             mActiveBPs[xID] = aBBP;
             var label = mEngine.mProcess.mDebugInfoDb.GetLabels(aBBP.mAddress)[0];
             mEngine.mProcess.INT3sSet.Add(new KeyValuePair <uint, string>(aBBP.mAddress, label));
             mDbgConnector.SetBreakpoint(xID, aBBP.mAddress);
             return(xID);
         }
     }
     throw new Exception("Maximum number of active breakpoints exceeded (" + MaxBP + ").");
 }
예제 #5
0
 //public AD7BreakpointBoundEvent(AD7PendingBreakpoint pendingBreakpoint, AD7BoundBreakpoint boundBreakpoint)
 public AD7BreakpointBoundEvent(AD7PendingBreakpoint pendingBreakpoint, AD7BoundBreakpoint boundBreakpoint = null)
 {
     _pendingBreakpoint = pendingBreakpoint;
     _boundBreakpoint   = boundBreakpoint;
 }
예제 #6
0
파일: AD7Events.cs 프로젝트: PeezoSlug/PTVS
 public AD7BreakpointBoundEvent(AD7PendingBreakpoint pendingBreakpoint, AD7BoundBreakpoint boundBreakpoint)
 {
     m_pendingBreakpoint = pendingBreakpoint;
     m_boundBreakpoint   = boundBreakpoint;
 }
예제 #7
0
 public void AddBoundBreakpoint(NodeBreakpoint breakpoint, AD7BoundBreakpoint boundBreakpoint)
 {
     _breakpointMap[breakpoint] = boundBreakpoint;
 }
예제 #8
0
 public void AddBoundBreakpoint(PythonBreakpoint breakpoint, AD7BoundBreakpoint boundBreakpoint)
 {
     _breakpointMap[breakpoint] = boundBreakpoint;
 }
예제 #9
0
 //public AD7BreakpointBoundEvent(AD7PendingBreakpoint pendingBreakpoint, AD7BoundBreakpoint boundBreakpoint)
 public AD7BreakpointBoundEvent(AD7PendingBreakpoint pendingBreakpoint, AD7BoundBreakpoint boundBreakpoint = null)
 {
     _pendingBreakpoint = pendingBreakpoint;
     _boundBreakpoint = boundBreakpoint;
 }
예제 #10
0
        // Binds this pending breakpoint to one or more code locations.
        int IDebugPendingBreakpoint2.Bind()
        {
            if (CanBind())
            {
                IDebugDocumentPosition2 docPosition = (IDebugDocumentPosition2)(Marshal.GetObjectForIUnknown(_bpRequestInfo.bpLocation.unionmember2));

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


                // Get the location in the document that the breakpoint is in.
                TEXT_POSITION[] startPosition = new TEXT_POSITION[1];
                TEXT_POSITION[] endPosition   = new TEXT_POSITION[1];
                EngineUtils.CheckOk(docPosition.GetRange(startPosition, endPosition));

                lock (_boundBreakpoints)
                {
                    if (_bpRequestInfo.guidLanguage == DebuggerConstants.guidLanguagePython)
                    {
                        PythonBreakpoint bp = _engine.Process.AddBreakpoint(
                            documentName,
                            (int)(startPosition[0].dwLine + 1),
                            _bpRequestInfo.bpCondition.styleCondition.ToPython(),
                            _bpRequestInfo.bpCondition.bstrCondition,
                            _bpRequestInfo.bpPassCount.stylePassCount.ToPython(),
                            (int)_bpRequestInfo.bpPassCount.dwPassCount);

                        AD7BreakpointResolution breakpointResolution = new AD7BreakpointResolution(_engine, bp, GetDocumentContext(bp));
                        AD7BoundBreakpoint      boundBreakpoint      = new AD7BoundBreakpoint(_engine, bp, this, breakpointResolution, _enabled);
                        _boundBreakpoints.Add(boundBreakpoint);
                        _bpManager.AddBoundBreakpoint(bp, boundBreakpoint);

                        if (_enabled)
                        {
                            TaskHelpers.RunSynchronouslyOnUIThread(ct => bp.AddAsync(ct));
                        }

                        return(VSConstants.S_OK);
                    }
                    else if (_bpRequestInfo.guidLanguage == DebuggerConstants.guidLanguageDjangoTemplate)
                    {
                        // bind a Django template
                        PythonBreakpoint bp = _engine.Process.AddDjangoBreakpoint(
                            documentName,
                            (int)(startPosition[0].dwLine + 1)
                            );

                        AD7BreakpointResolution breakpointResolution = new AD7BreakpointResolution(_engine, bp, GetDocumentContext(bp));
                        AD7BoundBreakpoint      boundBreakpoint      = new AD7BoundBreakpoint(_engine, bp, this, breakpointResolution, _enabled);
                        _boundBreakpoints.Add(boundBreakpoint);
                        _bpManager.AddBoundBreakpoint(bp, boundBreakpoint);

                        if (_enabled)
                        {
                            TaskHelpers.RunSynchronouslyOnUIThread(ct => bp.AddAsync(ct));
                        }

                        return(VSConstants.S_OK);
                    }
                }
            }

            // The breakpoint could not be bound. This may occur for many reasons such as an invalid location, an invalid expression, etc...
            // The Python engine does not support this.
            // TODO: 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);
        }