public virtual bool IsAsyncBreakSignal(Results results)
        {
            bool isAsyncBreak = false;

            if (results.TryFindString("reason") == "signal-received")
            {
                if (results.TryFindString("signal-name") == "SIGINT")
                {
                    isAsyncBreak = true;
                }
            }

            return(isAsyncBreak);
        }
Exemple #2
0
        private void HandleThreadGroupExited(Results results)
        {
            string threadGroupId      = results.TryFindString("id");
            bool   isThreadGroupEmpty = false;

            if (!String.IsNullOrEmpty(threadGroupId))
            {
                lock (_debuggeePids)
                {
                    if (_debuggeePids.Remove(threadGroupId))
                    {
                        isThreadGroupEmpty = _debuggeePids.Count == 0;
                    }
                }
            }

            if (isThreadGroupEmpty)
            {
                ScheduleStdOutProcessing(@"*stopped,reason=""exited""");

                // Processing the fake "stopped" event sent above will normally cause the debugger to close, but if
                //  the debugger process is already gone (e.g. because the terminal window was closed), we won't get
                //  a response, so queue a fake "exit" event for processing as well, just to be sure.
                ScheduleStdOutProcessing("^exit");
            }
        }
Exemple #3
0
        private async void OnStopped(Results results)
        {
            string reason = results.TryFindString("reason");

            if (reason.StartsWith("exited"))
            {
                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));
            }
        }
Exemple #4
0
        private void HandleThreadGroupExited(Results results)
        {
            string threadGroupId = results.TryFindString("id");

            if (!String.IsNullOrEmpty(threadGroupId))
            {
                lock (_debuggeePids)
                {
                    if (_debuggeePids.Remove(threadGroupId))
                    {
                        if (_debuggeePids.Count == 0)
                        {
                            ProcessState = ProcessState.Exited;
                        }
                    }
                }
            }

            if (ProcessState == ProcessState.Exited)
            {
                OnDebuggerProcessExit(null);
            }
        }
Exemple #5
0
 public virtual bool IsAsyncBreakSignal(Results results)
 {
     return(results.TryFindString("reason") == "signal-received" && results.TryFindString("signal-name") == "SIGINT");
 }