protected override DisconnectResponse HandleDisconnectRequest(DisconnectArguments arguments)
        {
            debugged.Close();
            debugged = null;

            return(new DisconnectResponse());
        }
        protected override LaunchResponse HandleLaunchRequest(LaunchArguments arguments)
        {
            Protocol.RegisterRequestType <InlineVairaleRequest, InlineVariableArguments>(HandleInlineVariable);
            this.Protocol.SendEvent(new InitializedEvent());
            Protocol.SendEvent(new OutputEvent("Launching..."));
            string address = arguments.ConfigurationProperties.GetValueAsString("address");

            if (String.IsNullOrEmpty(address))
            {
                throw new ProtocolException("Launch failed because launch configuration did not specify 'address'.");
            }

            string[] token = address.Split(':');

            if (token.Length < 2)
            {
                throw new ProtocolException($"Launch failed because 'address' is invalid({address}).");
            }
            string host = token[0];
            int    port;

            if (!int.TryParse(token[1], out port))
            {
                throw new ProtocolException($"Launch failed because 'address' is invalid({address}).");
            }

            this.stopAtEntry    = arguments.ConfigurationProperties.GetValueAsBool("stopAtEntry") ?? false;
            this.hyperStepSpeed = arguments.ConfigurationProperties.GetValueAsInt("hyperStepSpeed") ?? 0;

            debugged = new DebuggedProcessVSCode(this, host, port);
            while (debugged.Connecting)
            {
                System.Threading.Thread.Sleep(10);
            }

            if (debugged.Connected)
            {
                if (debugged.CheckDebugServerVersion())
                {
                    debugged.OnDisconnected = OnDisconnected;
                    return(new LaunchResponse());
                }
                else
                {
                    debugged.Close();
                    throw new ProtocolException(String.Format("ILRuntime Debugger version mismatch\n Expected version:{0}\n Actual version:{1}", DebuggerServer.Version, debugged.RemoteDebugVersion));
                }
            }
            else
            {
                debugged = null;
                throw new ProtocolException("Cannot connect to ILRuntime");
            }
        }
示例#3
0
 public VSCodeBreakPoint(DebuggedProcessVSCode debugged, Source source, int line, int column, string condition)
 {
     this.debugged  = debugged;
     bp             = new Breakpoint(false);
     bp.Id          = GetHashCode();
     bp.Source      = source;
     bp.Line        = line;
     bp.Column      = column;
     this.condition = condition;
     DocumentName   = source.Path;
     StartLine      = line - 1;
     StartColumn    = column > 0 ? column - 1 : 0;
 }
示例#4
0
 public VSCodeThread(DebuggedProcessVSCode engine, int id, string threadName)
 {
     this.engine = engine;
     thread      = new Thread(id, threadName);
 }