Ejemplo n.º 1
0
        // Binds this pending breakpoint to one or more code locations.
        int IDebugPendingBreakpoint2.Bind()
        {
            if (CanBind())
            {
                // Get the location in the document that the breakpoint is in.
                var startPosition = new TEXT_POSITION[1];
                var endPosition   = new TEXT_POSITION[1];
                var docPosition   = (IDebugDocumentPosition2)(Marshal.GetObjectForIUnknown(this._bpRequestInfo.bpLocation.unionmember2));
                EngineUtils.CheckOk(docPosition.GetRange(startPosition, endPosition));
                EngineUtils.CheckOk(docPosition.GetFileName(out var fileName));

                this._breakpoint = this._engine.Process.AddBreakpoint(
                    fileName,
                    (int)startPosition[0].dwLine,
                    (int)startPosition[0].dwColumn,
                    this._enabled,
                    AD7BoundBreakpoint.GetBreakOnForPassCount(this._bpRequestInfo.bpPassCount),
                    this._bpRequestInfo.bpCondition.bstrCondition);

                this._bpManager.AddPendingBreakpoint(this._breakpoint, this);
                this._breakpoint.BindAsync().WaitAsync(TimeSpan.FromSeconds(2)).Wait();

                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 sample 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);
        }
Ejemplo n.º 2
0
 public void AddBoundBreakpoint(NodeBreakpointBinding breakpointBinding, AD7BoundBreakpoint boundBreakpoint) {
     _breakpointBindingMap[breakpointBinding] = boundBreakpoint;
 }
Ejemplo n.º 3
0
 private void OnBreakpointBound(object sender, BreakpointBindingEventArgs e) {
     var pendingBreakpoint = _breakpointManager.GetPendingBreakpoint(e.Breakpoint);
     var breakpointBinding = e.BreakpointBinding;
     var codeContext = new AD7MemoryAddress(this, pendingBreakpoint.DocumentName, breakpointBinding.Target.Line, breakpointBinding.Target.Column);
     var documentContext = new AD7DocumentContext(codeContext);
     var breakpointResolution = new AD7BreakpointResolution(this, breakpointBinding, documentContext);
     var boundBreakpoint = new AD7BoundBreakpoint(breakpointBinding, pendingBreakpoint, breakpointResolution, breakpointBinding.Enabled);
     _breakpointManager.AddBoundBreakpoint(breakpointBinding, boundBreakpoint);
     Send(
         new AD7BreakpointBoundEvent(pendingBreakpoint, boundBreakpoint),
         AD7BreakpointBoundEvent.IID,
         null
     );
 }
Ejemplo n.º 4
0
 public void AddBoundBreakpoint(NodeBreakpointBinding breakpointBinding, AD7BoundBreakpoint boundBreakpoint)
 {
     this.breakpointBindingMap[breakpointBinding] = boundBreakpoint;
 }
Ejemplo n.º 5
0
 public AD7BreakpointUnboundEvent(AD7BoundBreakpoint boundBreakpoint) {
     m_boundBreakpoint = boundBreakpoint;
 }
Ejemplo n.º 6
0
 public AD7BreakpointBoundEvent(AD7PendingBreakpoint pendingBreakpoint, AD7BoundBreakpoint boundBreakpoint) {
     m_pendingBreakpoint = pendingBreakpoint;
     m_boundBreakpoint = boundBreakpoint;
 }
Ejemplo n.º 7
0
 public AD7BreakpointUnboundEvent(AD7BoundBreakpoint boundBreakpoint)
 {
     this.m_boundBreakpoint = boundBreakpoint;
 }
Ejemplo n.º 8
0
 public AD7BreakpointBoundEvent(AD7PendingBreakpoint pendingBreakpoint, AD7BoundBreakpoint boundBreakpoint)
 {
     this.m_pendingBreakpoint = pendingBreakpoint;
     this.m_boundBreakpoint   = boundBreakpoint;
 }