Example #1
0
        public static StopRecord FromArgumentList(NameValuePair[] arguments)
        {
            var result = new StopRecord();

            foreach (var arg in arguments)
            {
                switch (arg.Name)
                {
                case "reason":
                    result.Reason = arg.Value.ToStopReason();
                    break;

                case "frame":
                    result.Frame = Frame.FromDataString(arg.Value);
                    break;

                case "thread-id":
                    result.ThreadId = Convert.ToUInt32(arg.Value);
                    break;

                case "stopped-threads":
                    result.StoppedThreads = arg.Value;
                    break;

                case "bkptno":
                    result.BreakPointNumber = Convert.ToUInt32(arg.Value);
                    break;

                case "disp":
                    result.KeepBreakPoint = arg.Value == "keep";
                    break;

                default:
                    //Console.WriteLine ("Unimplemented stop record field detected.");
                    break;
                }
            }

            return(result);
        }
Example #2
0
		public static StopRecord FromArgumentList(NameValuePair[] arguments)
		{
			var result = new StopRecord();

			foreach (var arg in arguments)
			{
				switch (arg.Name)
				{
					case "reason":
						result.Reason = arg.Value.ToStopReason();
						break;

					case "frame":
						result.Frame = Frame.FromDataString(arg.Value);
						break;

					case "thread-id":
						result.ThreadId = Convert.ToUInt32(arg.Value);
						break;

					case "stopped-threads":
						result.StoppedThreads = arg.Value;
						break;

					case "bkptno":
						result.BreakPointNumber = Convert.ToUInt32(arg.Value);
						break;

					case "disp":
						result.KeepBreakPoint = arg.Value == "keep";
						break;

					default:
						//Console.WriteLine ("Unimplemented stop record field detected.");
						break;
				}
			}

			return result;
		}
Example #3
0
        private void debugger_Stopped(object sender, StopRecord e)
        {
            switch (e.Reason)
            {
            case StopReason.Exited:
            case StopReason.ExitedNormally:
            case StopReason.ExitedSignalled:
                var newList = new List <BreakPoint>();

                foreach (var breakPoint in this)
                {
                    newList.Add(new BreakPoint {
                        File = breakPoint.File, Line = breakPoint.Line
                    });
                }

                Clear();
                AddRange(newList);
                debugger = null;
                break;
            }
        }
		private async void debugger_Stopped(object sender, StopRecord e)
		{
			if (ignoreEvents)
			{
				return;
			}

			switch (e.Reason)
			{
				case StopReason.ExitedNormally:
				case StopReason.Exited:
				case StopReason.ExitedSignalled:
					IsExecuting = false;
					IsUpdating = false;
					StopDebugSession();
					break;

				default:
					IsUpdating = true;

					if (DebugFrameChanged != null)
					{
						var args = new FrameChangedEventArgs();
						args.Address = e.Frame.Address;
						args.VariableChanges = await currentDebugger.UpdateVariablesAsync();

						DebugFrameChanged(this, args);
					}

                    if (e.Frame != null && e.Frame.File != null)
                    {
                        var normalizedPath = e.Frame.File.Replace("\\\\", "\\").NormalizePath();

                        ISourceFile file = null;

                        var document = _shell.GetDocument(normalizedPath);

                        if (document != null)
                        {
                            lastDocument = document;
                            file = document?.ProjectFile;
                        }
                        
                        if (file == null)
                        {
                            file = _shell.CurrentSolution.FindFile(normalizedPath);
                        }

                        if (file != null)
                        {
                            await
                                Dispatcher.UIThread.InvokeTaskAsync(
                                    async () => { lastDocument = document = await _shell.OpenDocument(file, e.Frame.Line, 1, true); });
                        }
                        else
                        {
                            _console.WriteLine("Unable to find file: " + normalizedPath);
                        }
                    }

                    IsUpdating = false;
                    IsExecuting = false;
                    break;
			}
		}
Example #5
0
        private async void debugger_Stopped(object sender, StopRecord e)
        {
            if (ignoreEvents)
            {
                return;
            }

            switch (e.Reason)
            {
            case StopReason.ExitedNormally:
            case StopReason.Exited:
            case StopReason.ExitedSignalled:
                IsExecuting = false;
                IsUpdating  = false;
                StopDebugSession();
                break;

            default:
                IsUpdating = true;

                if (DebugFrameChanged != null)
                {
                    var args = new FrameChangedEventArgs();
                    args.Address         = e.Frame.Address;
                    args.VariableChanges = await currentDebugger.UpdateVariablesAsync();

                    DebugFrameChanged(this, args);
                }

                if (e.Frame != null && e.Frame.FullFileName != null)
                {
                    var normalizedPath = e.Frame.FullFileName.Replace("\\\\", "\\").NormalizePath();

                    ISourceFile file = null;

                    var document = _shell.GetDocument(normalizedPath);

                    if (document != null)
                    {
                        lastDocument = document;
                        file         = document?.ProjectFile;
                    }

                    if (file == null)
                    {
                        file = _shell.CurrentSolution.FindFile(normalizedPath);
                    }

                    if (file != null)
                    {
                        await
                        Dispatcher.UIThread.InvokeTaskAsync(
                            async() => { lastDocument = document = await _shell.OpenDocument(file, e.Frame.Line, 1, true); });
                    }
                    else
                    {
                        _console.WriteLine("Unable to find file: " + normalizedPath);
                    }
                }

                IsUpdating  = false;
                IsExecuting = false;
                break;
            }
        }