// Gets the breakpoint resolution information that describes this breakpoint.
        int IDebugBreakpointResolution2.GetResolutionInfo(enum_BPRESI_FIELDS dwFields, BP_RESOLUTION_INFO[] pBpResolutionInfo) {
            if ((dwFields & enum_BPRESI_FIELDS.BPRESI_BPRESLOCATION) != 0) {
                // The sample engine only supports code breakpoints.
                var location = new BP_RESOLUTION_LOCATION { bpType = (uint)enum_BP_TYPE.BPT_CODE };

                // The debugger will not QI the IDebugCodeContex2 interface returned here. We must pass the pointer
                // to IDebugCodeContex2 and not IUnknown.
                var codeContext = new AD7MemoryAddress(_engine, _binding.Target.FileName, _binding.Target.Line, _binding.Target.Column);
                codeContext.SetDocumentContext(_documentContext);
                location.unionmember1 = Marshal.GetComInterfaceForObject(codeContext, typeof(IDebugCodeContext2));
                pBpResolutionInfo[0].bpResLocation = location;
                pBpResolutionInfo[0].dwFields |= enum_BPRESI_FIELDS.BPRESI_BPRESLOCATION;
            }

            if ((dwFields & enum_BPRESI_FIELDS.BPRESI_PROGRAM) != 0) {
                pBpResolutionInfo[0].pProgram = _engine;
                pBpResolutionInfo[0].dwFields |= enum_BPRESI_FIELDS.BPRESI_PROGRAM;
            }

            return VSConstants.S_OK;
        }
 // Retrieves a list of all code contexts associated with this document context.
 // The engine sample only supports one code context per document context and 
 // the code contexts are always memory addresses.
 int IDebugDocumentContext2.EnumCodeContexts(out IEnumDebugCodeContexts2 ppEnumCodeCxts) {
     var codeContexts = new AD7MemoryAddress[1];
     codeContexts[0] = _codeContext;
     ppEnumCodeCxts = new AD7CodeContextEnum(codeContexts);
     return VSConstants.S_OK;
 }
 public AD7DocumentContext(AD7MemoryAddress codeContext) {
     _codeContext = codeContext;
 }
Ejemplo n.º 4
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.º 5
0
 // Adds a specified value to the current context's address to create a new context.
 public int Add(ulong dwCount, out IDebugMemoryContext2 newAddress)
 {
     newAddress = new AD7MemoryAddress(this._engine, this._frame, this._fileName, this._line + (int)dwCount, this._column);
     return(VSConstants.S_OK);
 }
Ejemplo n.º 6
0
 // Subtracts a specified value from the current context's address to create a new context.
 public int Subtract(ulong dwCount, out IDebugMemoryContext2 ppMemCxt)
 {
     ppMemCxt = new AD7MemoryAddress(this._engine, this._frame, this._fileName, this._line - (int)dwCount, this._column);
     return(VSConstants.S_OK);
 }
 // Adds a specified value to the current context's address to create a new context.
 public int Add(ulong dwCount, out IDebugMemoryContext2 newAddress) {
     newAddress = new AD7MemoryAddress(_engine, _frame, _fileName, _line + (int)dwCount, _column);
     return VSConstants.S_OK;
 }
 // Subtracts a specified value from the current context's address to create a new context.
 public int Subtract(ulong dwCount, out IDebugMemoryContext2 ppMemCxt) {
     ppMemCxt = new AD7MemoryAddress(_engine, _frame, _fileName, _line - (int)dwCount, _column);
     return VSConstants.S_OK;
 }