Ejemplo n.º 1
0
 public int Detach(IDebugSession2 pSession)
 {
     if (pSession == attachedSession)
     {
         attachedSession = null;
     }
     return(Microsoft.VisualStudio.VSConstants.S_OK);
 }
Ejemplo n.º 2
0
        public int Attach(IDebugSession2 pSession)
        {
            attachedSession = pSession;
            ctx             = new SquirrelDebugContext(DebugContextHandler, FileContexts);
            thread.SetContext(ctx);

            // temporary hack: if you try to connect when there's nothing to connect to,
            // it can put Visual Studio in an unstable state. This is because here, the DebugProcess,
            // is too late to attempt (and fail) to connect to the remote debugging port.
            // That should really have been done earlier, in the engine or program launch.
            // VS isn't capable of dealing with a failure in this function.
            bool bRetryConnect = false;

            do
            {
                bRetryConnect = false;
                engineCallback.OnOutputString("Connecting to" + IpAddress + ":" + IpPort);
                if (!ctx.Connect(IpAddress, IpPort))
                {
                    engineCallback.OnOutputString("ERROR: Cannot Connect to " + IpAddress + ":" + IpPort);
                    engineCallback.OnError(null, "Cannot Connect to debugee");

                    switch (MessageBox.Show("Could not find a Squirrel VM to connect the debugger to.\n" +
                                            "You can either launch the game, run script_debug, and hit 'retry',\n" +
                                            "or cancel, 'stop debugging' and try again later.", "Temporary Failsafe", MessageBoxButtons.RetryCancel, MessageBoxIcon.Hand))
                    {
                    case DialogResult.Retry:
                        bRetryConnect = true;
                        break;

                    /* // This code path, although apparently correct, will actually cause Visual Studio to fail with a "could not detach from process" error.
                     * // It's some cryptic COM error to do with the invoked process object having disconnected from its clients.
                     * case DialogResult.Abort:
                     * port.SendProcessCreateEvent();
                     * return Microsoft.VisualStudio.VSConstants.E_FAIL;
                     */
                    case DialogResult.Ignore:
                    case DialogResult.Cancel:
                    default:
                        break;
                    }

                    /*
                     * ctx = null;
                     * // attachedSession = null;
                     * return Microsoft.VisualStudio.VSConstants.E_FAIL;
                     */
                }
            } while (bRetryConnect);


            port.SendProcessCreateEvent();
            return(Microsoft.VisualStudio.VSConstants.S_OK);
        }
Ejemplo n.º 3
0
 int IDebugProcessEx2.Detach(IDebugSession2 pSession)
 {
     _program = null;
     return HR.S_OK;
 }
Ejemplo n.º 4
0
 int IDebugProcessEx2.Attach(IDebugSession2 pSession)
 {
     return HR.S_OK;
 }
Ejemplo n.º 5
0
 public int OnSessionDestroy(IDebugSession2 pSession)
 {
     SessionDestroyed(this, EventArgs.Empty);
     return(VSConstants.S_OK);
 }
Ejemplo n.º 6
0
 /// <summary>
 /// Informs the process that a session is no longer debugging the process. (http://msdn.microsoft.com/en-us/library/bb146313.aspx)
 /// </summary>
 /// <param name="pSession"> A value that uniquely identifies the session to detach this process from. </param>
 /// <returns> VSConstants.S_OK. </returns>
 public int Detach(IDebugSession2 pSession)
 {
     session = pSession;
     return(VSConstants.S_OK);
 }
Ejemplo n.º 7
0
 int IDebugProcessEx2.Detach(IDebugSession2 pSession)
 {
     _program = null;
     return(HR.S_OK);
 }
Ejemplo n.º 8
0
 /// <summary>
 /// Informs the process that a session is no longer debugging the process. (http://msdn.microsoft.com/en-us/library/bb146313.aspx)
 /// </summary>
 /// <param name="pSession"> A value that uniquely identifies the session to detach this process from. </param>
 /// <returns> VSConstants.S_OK. </returns>
 public int Detach(IDebugSession2 pSession)
 {
     session = pSession;
     return VSConstants.S_OK;
 }
 int Microsoft.VisualStudio.Debugger.Interop.IDebugProgramEx2.Attach(IDebugEventCallback2 pCallback, uint dwReason, IDebugSession2 pSession)
 {
     //This needs to return false to allow cpde to do the attach
     return(COM_HResults.S_FALSE);
 }
Ejemplo n.º 10
0
 int IDebugProcessEx2.Detach(IDebugSession2 pSession)
 {
     throw new NotImplementedException();
 }
 public int Attach(IDebugEventCallback2 pCallback, uint dwReason, IDebugSession2 pSession)
 {
     throw new NotImplementedException();
 }
Ejemplo n.º 12
0
 int IDebugProcessEx2.Attach(IDebugSession2 pSession)
 {
     return(Constants.S_OK);
 }
 public int OnSessionDestroy(IDebugSession2 pSession) {
     SessionDestroyed(this, EventArgs.Empty);
     return VSConstants.S_OK;
 }
 public int OnSessionCreate(IDebugSession2 pSession) {
     SessionCreated(this, EventArgs.Empty);
     return VSConstants.S_OK;
 }
Ejemplo n.º 15
0
 public int Detach(IDebugSession2 pSession)
 {
     throw new NotImplementedException();
 }
Ejemplo n.º 16
0
 int Microsoft.VisualStudio.Debugger.Interop.IDebugProcessEx2.Detach(IDebugSession2 pSession)
 {
     return Utility.COM_HResults.S_OK;
 }
Ejemplo n.º 17
0
 int Microsoft.VisualStudio.Debugger.Interop.IDebugProgramEx2.Attach(IDebugEventCallback2 pCallback, uint dwReason, IDebugSession2 pSession)
 {
     //This needs to return false to allow cpde to do the attach
     return Utility.COM_HResults.S_FALSE;
 }
Ejemplo n.º 18
0
        int Microsoft.VisualStudio.Debugger.Interop.IDebugProcessEx2.Attach(IDebugSession2 pSession)
        {
            int hr = Utility.COM_HResults.S_OK;

            //check if the process is still alive.  For emulator, if the process is still alive.
            if (!m_port.ContainsProcess(this))
            {
                hr = Utility.COM_HResults.E_PROCESS_DESTROYED;
            }

            return hr;
        }
Ejemplo n.º 19
0
 int IDebugProcessEx2.Attach(IDebugSession2 pSession)
 {
     return(HR.S_OK);
 }
Ejemplo n.º 20
0
 public int Detach(IDebugSession2 pSession)
 {
     DLog.Debug(DContext.VSDebuggerComCall, "DebugProcess.Detach");
     return VSConstants.S_OK;
 }
Ejemplo n.º 21
0
 public int Attach(IDebugEventCallback2 pCallback, uint dwReason, IDebugSession2 pSession)
 {
     throw new NotImplementedException();
 }
Ejemplo n.º 22
0
 public int Detach(IDebugSession2 pSession)
 {
     DLog.Debug(DContext.VSDebuggerComCall, "DebugProcess.Detach");
     return(VSConstants.S_OK);
 }