Esempio n. 1
0
        private async void OnStopped(Results results)
        {
            string reason = results.TryFindString("reason");

            if (reason.StartsWith("exited"))
            {
                string threadGroupId = results.TryFindString("id");
                if (!String.IsNullOrEmpty(threadGroupId))
                {
                    lock (_debuggeePids)
                    {
                        _debuggeePids.Remove(threadGroupId);
                    }
                }

                if (IsLocalGdbAttach())
                {
                    CmdExitAsync();
                }

                this.ProcessState = ProcessState.Exited;
                if (ProcessExitEvent != null)
                {
                    ProcessExitEvent(this, new ResultEventArgs(results));
                }
                return;
            }

            //if this is an exception reported from LLDB, it will not currently contain a frame object in the MI
            //if we don't have a frame, check if this is an excpetion and retrieve the frame
            if (!results.Contains("frame") &&
                string.Compare(reason, "exception-received", StringComparison.OrdinalIgnoreCase) == 0
                )
            {
                //get the info for the current frame
                Results frameResult = await MICommandFactory.StackInfoFrame();

                //add the frame to the stopping results
                results.Add("frame", frameResult.Find("frame"));
            }

            bool fIsAsyncBreak = MICommandFactory.IsAsyncBreakSignal(results);

            if (await DoInternalBreakActions(fIsAsyncBreak))
            {
                return;
            }

            this.ProcessState = ProcessState.Stopped;
            FlushBreakStateData();

            if (!results.Contains("frame"))
            {
                if (ModuleLoadEvent != null)
                {
                    ModuleLoadEvent(this, new ResultEventArgs(results));
                }
            }
            else if (BreakModeEvent != null)
            {
                if (fIsAsyncBreak)
                {
                    _requestingRealAsyncBreak = false;
                }
                BreakModeEvent(this, new ResultEventArgs(results));
            }
        }