Esempio n. 1
0
        void HostShutdown(object sender, EventArgs e)
        {
            //AD7ThreadDestroyEvent.Send(mEngine, mThread, (uint)mProcess.ExitCode);
            //mCallback.OnProgramDestroy((uint)mProcess.ExitCode);

            // We dont use process info any more, but have to call this to tell
            // VS to stop debugging.
            if (Interlocked.CompareExchange(ref mProcessExitEventSent, 1, 0) == 0)
            {
                try
                {
                    mCallback.OnProcessExit(0);
                }
                catch
                {
                    // swallow exceptions here?
                }
            }

            if (mDbgConnector != null)
            {
                mDbgConnector.Dispose();
                mDbgConnector = null;
            }
            if (mDebugInfoDb != null)
            {
                // Commented for debugging, so we can look at the DB after
                //mDebugInfoDb.DeleteDB();
                mDebugInfoDb.Dispose();
                mDebugInfoDb = null;
            }
        }
Esempio n. 2
0
        private void HandleRunning(DebugConnector debugConnector, Base host)
        {
            if (debugConnector == null)
            {
                throw new ArgumentNullException("debugConnector");
            }
            if (host == null)
            {
                throw new ArgumentNullException("host");
            }
            mKernelRunning = true;

            host.Start();
            try
            {
                var xStartTime = DateTime.Now;
                mKernelResultSet = false;
                Interlocked.Exchange(ref mSucceededAssertions, 0);

                while (mKernelRunning)
                {
                    Thread.Sleep(50);

                    if (Math.Abs(DateTime.Now.Subtract(xStartTime).TotalSeconds) > AllowedSecondsInKernel)
                    {
                        OutputHandler.SetKernelTestResult(false, "Timeout exceeded");
                        mKernelResultSet = true;
                        break;
                    }
                }

                if (mKernelResultSet)
                {
                    //OutputHandler.SetKernelTestResult(true, null);
                    OutputHandler.SetKernelSucceededAssertionsCount(mSucceededAssertions);
                }
                else
                {
                    KernelTestFailed();
                }
            }
            finally
            {
                Console.WriteLine("Stopping now");
                host.Stop();
                debugConnector.Dispose();
                Thread.Sleep(50);
            }
        }
Esempio n. 3
0
        private void HandleRunning(DebugConnector debugConnector, Host host)
        {
            if (debugConnector == null)
            {
                throw new ArgumentNullException("debugConnector");
            }
            if (host == null)
            {
                throw new ArgumentNullException("host");
            }

            mKernelRunning = true;
            host.Start();

            try
            {
                var xStartTime = DateTime.Now;
                Interlocked.Exchange(ref mSucceededAssertions, 0);

                while (mKernelRunning)
                {
                    Thread.Sleep(50);

                    if (Math.Abs(DateTime.Now.Subtract(xStartTime).TotalSeconds) > AllowedSecondsInKernel)
                    {
                        throw new TimeoutException("Timeout exceeded!");
                    }
                }
            }
            finally
            {
                host.Stop();
                debugConnector.Dispose();
                Thread.Sleep(50);
            }
        }