コード例 #1
0
        void AcceptDebuggee(string command, int seq, dynamic args, TcpListener listener)
        {
            if (!ReadBasicConfiguration(command, seq, args))
            {
                return;
            }

            var encodingName = (string)args.encoding;

            if (encodingName != null)
            {
                int codepage;
                if (int.TryParse(encodingName, out codepage))
                {
                    encoding = Encoding.GetEncoding(codepage);
                }
                else
                {
                    encoding = Encoding.GetEncoding(encodingName);
                }
            }
            else
            {
                encoding = Encoding.UTF8;
            }

            Program.WaitingUI.SetLabelText("Waiting for debugee at TCP " + listener.LocalEndpoint.ToString() + "...");

            var ncom = new DebuggeeProtocol(this, listener, encoding);

            this.startCommand = command;
            this.startSeq     = seq;
            ncom.StartThread();
        }
コード例 #2
0
        void IDebuggeeListener.X_DebuggeeHasGone()
        {
            System.Threading.Thread.Sleep(500);
            lock (this)
            {
                if (fakeBreakpointMode != null)
                {
                    return;
                }

                // attach 일 경우 Terminate하지 않고 재시작
                if (startCommand == "attach")
                {
                    toDebuggee = null;

                    Program.WaitingUI.BeginInvoke(new Action(() =>
                    {
                        Program.WaitingUI.Show();
                    }));

                    listener.Start();

                    Program.WaitingUI.SetLabelText(
                        "Waiting for debugee at TCP " +
                        listener.LocalEndpoint.ToString() + "...");

                    var ncom = new DebuggeeProtocol(
                        this,
                        listener,
                        encoding);

                    ncom.StartThread();
                }
                else
                {
                    toVSCode.SendMessage(new TerminatedEvent());
                }
            }
        }