public ProviderRequestData(enum_PROVIDER_FLAGS flags, IDebugDefaultPort2 port, AD_PROCESS_ID processId, Guid launchingEngine, IDebugPortNotify2 callback)
            {
                _flags = flags;
                _port  = port != null?port.GetPortId() : Guid.Empty;

                _processId       = processId.dwProcessId;
                _launchingEngine = launchingEngine;
                _callback        = callback;
            }
 /// <summary>
 /// Allows the process to be notified of port events.
 /// </summary>
 /// <param name="Flags">
 /// A combination of flags from the PROVIDER_FLAGS enumeration. The following flags are typical for this call:
 ///
 /// Flag                         Description
 /// PFLAG_REMOTE_PORT            Caller is running on remote machine.
 /// PFLAG_DEBUGGEE               Caller is currently being debugged (additional information about marshalling is returned for each node).
 /// PFLAG_ATTACHED_TO_DEBUGGEE   Caller was attached to but not launched by the debugger.
 /// PFLAG_REASON_WATCH           Caller wants to watch for events. If this flag is not set. then the callback event is removed and the caller no longer receives notifications.
 /// </param>
 /// <param name="pPort">The port the calling process is running on.</param>
 /// <param name="ProcessId">An AD_PROCESS_ID structure holding the ID of the process that contains the program in question.</param>
 /// <param name="EngineFilter">An array of GUIDs of debug engines associated with the process.</param>
 /// <param name="guidLaunchingEngine">GUID of the debug engine that launched this process (if any).</param>
 /// <param name="pEventCallback">An IDebugPortNotify2 object that receives the event notifications.</param>
 /// <returns>If successful, returns S_OK; otherwise, returns an error code.</returns>
 /// <remarks>When a caller wants to remove an event handler that was established with a previous call to this method, the caller passes the same parameters as it did the first time but leaves off the PFLAG_REASON_WATCH flag.</remarks>
 public virtual int WatchForProviderEvents(enum_PROVIDER_FLAGS Flags,
                                           IDebugDefaultPort2 pPort,
                                           AD_PROCESS_ID ProcessId,
                                           CONST_GUID_ARRAY EngineFilter,
                                           ref Guid guidLaunchingEngine,
                                           IDebugPortNotify2 pEventCallback)
 {
     Logger.Debug(string.Empty);
     return(VSConstants.E_NOTIMPL);
 }
示例#3
0
 int IDebugProgramProvider2.WatchForProviderEvents(
     enum_PROVIDER_FLAGS Flags,
     IDebugDefaultPort2 pPort,
     AD_PROCESS_ID ProcessId,
     CONST_GUID_ARRAY EngineFilter,
     ref Guid guidLaunchingEngine,
     IDebugPortNotify2 pEventCallback)
 {
     return(VSConstants.S_OK);
 }
示例#4
0
    // Establishes a callback to watch for provider events associated with specific kinds of processes
    int IDebugProgramProvider2.WatchForProviderEvents(enum_PROVIDER_FLAGS Flags, IDebugDefaultPort2 port, AD_PROCESS_ID ProcessId, CONST_GUID_ARRAY EngineFilter, ref Guid guidLaunchingEngine, IDebugPortNotify2 ad7EventCallback) {
      // The sample debug engine is a native debugger, and can therefore always provide a program node
      // in GetProviderProcessData. Non-native debuggers may wish to implement this method as a way
      // of monitoring the process before code for their runtime starts. For example, if implementing a 
      // 'foo script' debug engine, one could attach to a process which might eventually run 'foo script'
      // before this 'foo script' started.
      //
      // To implement this method, an engine would monitor the target process and call AddProgramNode
      // when the target process started running code which was debuggable by the engine. The 
      // enum_PROVIDER_FLAGS.PFLAG_ATTACHED_TO_DEBUGGEE flag indicates if the request is to start
      // or stop watching the process.

      return VSConstants.S_OK;
    }
        // Establishes a callback to watch for provider events associated with specific kinds of processes
        int IDebugProgramProvider2.WatchForProviderEvents(enum_PROVIDER_FLAGS Flags, IDebugDefaultPort2 port, AD_PROCESS_ID ProcessId, CONST_GUID_ARRAY EngineFilter, ref Guid guidLaunchingEngine,
                                                          IDebugPortNotify2 ad7EventCallback)
        {
            // The sample debug engine is a native debugger, and can therefore always provide a program node
            // in GetProviderProcessData. Non-native debuggers may wish to implement this method as a way
            // of monitoring the process before code for their runtime starts. For example, if implementing a
            // 'foo script' debug engine, one could attach to a process which might eventually run 'foo script'
            // before this 'foo script' started.
            //
            // To implement this method, an engine would monitor the target process and call AddProgramNode
            // when the target process started running code which was debuggable by the engine. The
            // enum_PROVIDER_FLAGS.PFLAG_ATTACHED_TO_DEBUGGEE flag indicates if the request is to start
            // or stop watching the process.

            return(VSConstants.S_OK);
        }
 /// <summary>
 /// Allows the process to be notified of port events.
 /// </summary>
 /// <param name="Flags">
 /// A combination of flags from the PROVIDER_FLAGS enumeration. The following flags are typical for this call:
 /// 
 /// Flag                         Description
 /// PFLAG_REMOTE_PORT            Caller is running on remote machine.
 /// PFLAG_DEBUGGEE               Caller is currently being debugged (additional information about marshalling is returned for each node).
 /// PFLAG_ATTACHED_TO_DEBUGGEE   Caller was attached to but not launched by the debugger.
 /// PFLAG_REASON_WATCH           Caller wants to watch for events. If this flag is not set. then the callback event is removed and the caller no longer receives notifications.
 /// </param>
 /// <param name="pPort">The port the calling process is running on.</param>
 /// <param name="ProcessId">An AD_PROCESS_ID structure holding the ID of the process that contains the program in question.</param>
 /// <param name="EngineFilter">An array of GUIDs of debug engines associated with the process.</param>
 /// <param name="guidLaunchingEngine">GUID of the debug engine that launched this process (if any).</param>
 /// <param name="pEventCallback">An IDebugPortNotify2 object that receives the event notifications.</param>
 /// <returns>If successful, returns S_OK; otherwise, returns an error code.</returns>
 /// <remarks>When a caller wants to remove an event handler that was established with a previous call to this method, the caller passes the same parameters as it did the first time but leaves off the PFLAG_REASON_WATCH flag.</remarks>
 public virtual int WatchForProviderEvents( enum_PROVIDER_FLAGS Flags,
     IDebugDefaultPort2 pPort,
     AD_PROCESS_ID ProcessId,
     CONST_GUID_ARRAY EngineFilter,
     ref Guid guidLaunchingEngine,
     IDebugPortNotify2 pEventCallback)
 {
     Logger.Debug( string.Empty );
     return VSConstants.E_NOTIMPL;
 }
示例#7
0
 public int GetPortNotify(out IDebugPortNotify2 portNotify)
 {
     portNotify = _portNotify;
     return(HRConstants.S_OK);
 }
示例#8
0
 internal AD7Port(IDebugPortNotify2 portNotify)
 {
     _portNotify = portNotify;
 }
 public int WatchForProviderEvents(enum_PROVIDER_FLAGS Flags, IDebugDefaultPort2 pPort, AD_PROCESS_ID ProcessId,
     CONST_GUID_ARRAY EngineFilter, ref Guid guidLaunchingEngine, IDebugPortNotify2 pEventCallback)
 {
     DebugHelper.TraceEnteringMethod();
     return VSConstants.S_OK;
 }
 /// <summary>
 ///     Establishes a callback to watch for provider events associated with specific kinds of processes.
 /// </summary>
 /// <param name="flags">The flags.</param>
 /// <param name="port">The port.</param>
 /// <param name="processId">The process identifier.</param>
 /// <param name="engineFilter">The engine filter.</param>
 /// <param name="guidLaunchingEngine">The unique identifier launching engine.</param>
 /// <param name="eventCallback">The event callback.</param>
 /// <returns>If successful, returns S_OK; otherwise, returns an error code.</returns>
 public int WatchForProviderEvents(enum_PROVIDER_FLAGS flags, IDebugDefaultPort2 port, AD_PROCESS_ID processId,
                                   CONST_GUID_ARRAY engineFilter, ref Guid guidLaunchingEngine, IDebugPortNotify2 eventCallback)
 {
     return(S_OK);
 }
示例#11
0
 /// <summary>
 /// This method gets an IDebugPortNotify2 interface for this port.
 /// </summary>
 public int GetPortNotify(out IDebugPortNotify2 ppPortNotify)
 {
     DLog.Debug(DContext.VSDebuggerComCall, "DebugPort.GetPortNotify");
     ppPortNotify = this;
     return VSConstants.S_OK;
 }
        /// <summary>
        /// Allows the process to be notified of port events.
        /// </summary>
        /// <param name="flags">A combination of flags from the <see cref="PROVIDER_FLAGS"/> enumeration.</param>
        /// <param name="port">The port the calling process is running on.</param>
        /// <param name="processId">An <see cref="AD_PROCESS_ID"/> structure holding the ID of the process that contains the program in question.</param>
        /// <param name="engineFilter">An array of GUIDs of debug engines associated with the process.</param>
        /// <param name="guidLaunchingEngine">GUID of the debug engine that launched this process (if any).</param>
        /// <param name="eventCallback">An <see cref="IDebugPortNotify2"/> object that receives the event notifications.</param>
        /// <returns>If successful, returns S_OK; otherwise, returns an error code.</returns>
        /// <remarks>
        /// When a caller wants to remove an event handler established with a previous call to this method,
        /// the caller passes the same parameters as it did the first time but leaves off the PFLAG_REASON_WATCH flag.
        /// </remarks>
        public int WatchForProviderEvents(enum_PROVIDER_FLAGS flags, IDebugDefaultPort2 port, AD_PROCESS_ID processId, CONST_GUID_ARRAY engineFilter, ref Guid guidLaunchingEngine, IDebugPortNotify2 eventCallback)
        {
            /* The following flags are typical for this call:
             *
             *   PFLAG_REMOTE_PORT:             Caller is running on remote machine.
             *   PFLAG_DEBUGGEE:                Caller is currently being debugged (additional information about marshalling is returned for each node).
             *   PFLAG_ATTACHED_TO_DEBUGGEE:    Caller was attached to but not launched by the debugger.
             *   PFLAG_REASON_WATCH:            Caller wants to watch for events. If this flag is not set, then the callback event is removed and the caller no longer receives notifications.
             */

            // make sure this request is relevant to this debug engine
            if (!engineFilter.AsEnumerable().Contains(JavaDebuggerConstants.JavaDebugEngineGuid))
            {
                return(VSConstants.S_OK);
            }

            ProviderRequestData requestData = new ProviderRequestData(flags, port, processId, guidLaunchingEngine, eventCallback);

            if ((flags & enum_PROVIDER_FLAGS.PFLAG_REASON_WATCH) == 0)
            {
                _subscribers.Remove(requestData);
                return(VSConstants.S_OK);
            }

            _subscribers.Add(requestData);
            eventCallback.AddProgramNode(new JavaDebugProgram(port.GetProcess(processId)));
            return(VSConstants.S_OK);
        }
示例#13
0
 /// <summary>
 /// This method gets an IDebugPortNotify2 interface for this port.
 /// </summary>
 public int GetPortNotify(out IDebugPortNotify2 ppPortNotify)
 {
     DLog.Debug(DContext.VSDebuggerComCall, "DebugPort.GetPortNotify");
     ppPortNotify = this;
     return(VSConstants.S_OK);
 }
 public int WatchForProviderEvents(enum_PROVIDER_FLAGS Flags, IDebugDefaultPort2 pPort, AD_PROCESS_ID ProcessId,
                                   CONST_GUID_ARRAY EngineFilter, ref Guid guidLaunchingEngine, IDebugPortNotify2 pEventCallback)
 {
     DebugHelper.TraceEnteringMethod();
     return(VSConstants.S_OK);
 }
 int IDebugProgramProvider2.WatchForProviderEvents(enum_PROVIDER_FLAGS Flags, IDebugDefaultPort2 pPort, AD_PROCESS_ID ProcessId, CONST_GUID_ARRAY EngineFilter, ref Guid guidLaunchingEngine, IDebugPortNotify2 pEventCallback)
 {
   return VSConstants.S_OK;
 }
示例#16
0
 /// <summary>
 /// This method gets an IDebugPortNotify2 interface for this port.
 /// </summary>
 /// <param name="ppPortNotify">An IDebugPortNotify2 object.</param>
 /// <returns>If successful, returns S_OK; otherwise, returns an error code.</returns>
 /// <remarks>
 /// Normally, the QueryInterface method is called on the object implementing the IDebugPort2 interface to obtain an IDebugPortNotify2 interface. However, there are circumstances in which the desired interface is implemented on a different object. This method hides those circumstances and returns the IDebugPortNotify2 interface from the most appropriate object.
 /// </remarks>
 public virtual int GetPortNotify(out IDebugPortNotify2 ppPortNotify)
 {
     Logger.Debug(string.Empty);
     ppPortNotify = null;
     return(VSConstants.E_NOTIMPL);
 }
示例#17
0
 public int GetPortNotify(out IDebugPortNotify2 ppPortNotify)
 {
     ppPortNotify = portNotify;
     return(VSConstants.S_OK);
 }
示例#18
0
 DefaultPort(IDebugPortNotify2 portNotify)
 {
     this.portNotify = portNotify;
 }
示例#19
0
 public Port Create(IDebugPortNotify2 portNotify) =>
 new DefaultPort(portNotify);
示例#20
0
 public int GetPortNotify(out IDebugPortNotify2 ppPortNotify)
 {
     throw new NotImplementedException();
 }
 public int WatchForProviderEvents(uint Flags, IDebugDefaultPort2 pPort, AD_PROCESS_ID ProcessId, CONST_GUID_ARRAY EngineFilter, ref Guid guidLaunchingEngine, IDebugPortNotify2 pEventCallback)
 {
     return(S_OK);
 }
 public int GetPortNotify(out IDebugPortNotify2 ppPortNotify)
 {
     ppPortNotify = (IDebugPortNotify2)this;
     return(Microsoft.VisualStudio.VSConstants.S_OK);
 }
示例#23
0
 /// <summary>
 /// This method gets an IDebugPortNotify2 interface for this port.
 /// </summary>
 /// <param name="ppPortNotify">An IDebugPortNotify2 object.</param>
 /// <returns>If successful, returns S_OK; otherwise, returns an error code.</returns>
 /// <remarks>
 /// Normally, the QueryInterface method is called on the object implementing the IDebugPort2 interface to obtain an IDebugPortNotify2 interface. However, there are circumstances in which the desired interface is implemented on a different object. This method hides those circumstances and returns the IDebugPortNotify2 interface from the most appropriate object.
 /// </remarks>
 public virtual int GetPortNotify( out IDebugPortNotify2 ppPortNotify )
 {
     Logger.Debug( string.Empty );
     ppPortNotify = null;
     return VSConstants.E_NOTIMPL;
 }