예제 #1
0
        private void OnEndSession()
        {
            Dispatcher.UIThread.InvokeAsync(() =>
            {
                DebugSessionEnded?.Invoke(this, new EventArgs());

                _shell.CurrentPerspective = Perspective.Editor;

                _lastDocument?.ClearDebugHighlight();
                _lastDocument = null;
            });

            lock (_sessionLock)
            {
                if (_session != null)
                {
                    _session.Exit();
                    _session.TargetStopped       -= _session_TargetStopped;
                    _session.TargetHitBreakpoint -= _session_TargetStopped;
                    _session.TargetSignaled      -= _session_TargetStopped;
                    _session.TargetInterrupted   -= _session_TargetStopped;
                    _session.TargetExited        -= _session_TargetExited;
                    _session.TargetStarted       -= _session_TargetStarted;
                    _session.TargetReady         -= _session_TargetReady;
                    _session.Dispose();
                    _session = null;
                }
            }

            // This will save breakpoints that were moved to be closer to actual sequence points.
            Breakpoints.Save();
        }
예제 #2
0
        private void OnEndSession()
        {
            lock (_sessionLock)
            {
                if (_session != null)
                {
                    _session.TargetUnhandledException -= _session_TargetStopped;
                    _session.TargetStopped            -= _session_TargetStopped;
                    _session.TargetHitBreakpoint      -= _session_TargetStopped;
                    _session.TargetSignaled           -= _session_TargetStopped;
                    _session.TargetInterrupted        -= _session_TargetStopped;
                    _session.TargetExited             -= _session_TargetExited;
                    _session.TargetStarted            -= _session_TargetStarted;
                    _session.TargetReady -= _session_TargetReady;

                    _session?.Dispose();
                    _session = null;
                }
            }

            Dispatcher.UIThread.InvokeAsync(() =>
            {
                DebugSessionEnded?.Invoke(this, EventArgs.Empty);

                _studio.CurrentPerspective = Perspective.Normal;

                _lastDocument?.ClearDebugHighlight();
                _lastDocument = null;

                // This will save breakpoints that were moved to be closer to actual sequence points.
                Breakpoints.Save();
            });
        }