當前位置: 首頁>>代碼示例>>C#>>正文


C# Client.DebuggerStartInfo類代碼示例

本文整理匯總了C#中Mono.Debugging.Client.DebuggerStartInfo的典型用法代碼示例。如果您正苦於以下問題:C# DebuggerStartInfo類的具體用法?C# DebuggerStartInfo怎麽用?C# DebuggerStartInfo使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


DebuggerStartInfo類屬於Mono.Debugging.Client命名空間,在下文中一共展示了DebuggerStartInfo類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: GetConnectingMessage

        protected override string GetConnectingMessage (DebuggerStartInfo startInfo)
        {
            var dsi = (TizenSoftDebuggerStartInfo) startInfo;
            var dra = (SoftDebuggerRemoteArgs) dsi.StartArgs;

            return string.Format ("Waiting for debugger to connect on {0}:{1}...", dra.Address, dra.DebugPort);
        }
開發者ID:kitsilanosoftware,項目名稱:MonoDevelop.Tizen,代碼行數:7,代碼來源:TizenSoftDebuggerSession.cs

示例2: CreateDebuggerStartInfo

        public DebuggerStartInfo CreateDebuggerStartInfo (ExecutionCommand command)
        {
            DotNetExecutionCommand cmd = command as DotNetExecutionCommand;
            if (cmd != null) {
                DebuggerStartInfo startInfo = new DebuggerStartInfo ();
                startInfo.Command = cmd.Command;
                startInfo.Arguments = cmd.Arguments;
                startInfo.WorkingDirectory = cmd.WorkingDirectory;
                if (cmd.EnvironmentVariables.Count > 0) {
                    foreach (KeyValuePair<string, string> val in cmd.EnvironmentVariables)
                        startInfo.EnvironmentVariables[val.Key] = val.Value;
                }
                return startInfo;
            }
            AspNetExecutionCommand acmd = command as AspNetExecutionCommand;
            if (acmd != null) {
                DebuggerStartInfo startInfo = new DebuggerStartInfo ();
                string xspName = (acmd.ClrVersion == ClrVersion.Net_1_1) ? "xsp" : "xsp2";
                string xspPath = acmd.TargetRuntime.GetToolPath (acmd.TargetFramework, xspName);
                if (!File.Exists (xspPath))
                    throw new UserException (string.Format ("The \"{0}\" web server cannot be started. Please ensure that it is installed.", xspName), null);

                startInfo.Command = xspPath;
                startInfo.Arguments = acmd.XspParameters.GetXspParameters () + " --nonstop";
                startInfo.WorkingDirectory = acmd.BaseDirectory;

                // Set DEVPATH when running on Windows (notice that this has no effect unless
                // <developmentMode developerInstallation="true" /> is set in xsp2.exe.config

                startInfo.EnvironmentVariables["DEVPATH"] = Path.GetDirectoryName (xspPath);
                return startInfo;
            }
            throw new NotSupportedException ();
        }
開發者ID:transformersprimeabcxyz,項目名稱:monodevelop-1,代碼行數:34,代碼來源:CorDebuggerEngine.cs

示例3: OnRun

        /*protected override string GetConnectingMessage (SoftDebuggerStartInfo dsi)
        {
            return string.Format ("Waiting for debugger to connect on {0}:{1}...", dsi.Address, dsi.DebugPort);
        }*/
        protected override void OnRun(DebuggerStartInfo startInfo)
        {
            var dsi = (MonoBrickSoftDebuggerStartInfo)startInfo;
            StartProcess(dsi);
            Thread.Sleep(500);
            StartConnecting(dsi);
        }
開發者ID:RoninWest,項目名稱:monoev3,代碼行數:11,代碼來源:MonoBrickAddinDebuggerSession.cs

示例4: OnRun

        protected override void OnRun (DebuggerStartInfo startInfo)
        {
            var dsi = (MoonlightDebuggerStartInfo) startInfo;
            int assignedDebugPort;
            StartListening (dsi, out assignedDebugPort);
            StartBrowserProcess (dsi, assignedDebugPort);
        }
開發者ID:FreeBSD-DotNet,項目名稱:monodevelop,代碼行數:7,代碼來源:MoonlightSoftDebuggerSession.cs

示例5: OnRun

        /// <summary>
        ///   Called when debugger runs.
        /// </summary>
        /// <param name = "startInfo">The start info.</param>
        protected override void OnRun(DebuggerStartInfo startInfo)
        {
            MonobjcDebuggerStartInfo dsi = (MonobjcDebuggerStartInfo)startInfo;
            SoftDebuggerRemoteArgs startArgs = (SoftDebuggerRemoteArgs)dsi.StartArgs;
            MonobjcExecutionCommand command = dsi.ExecutionCommand;

            int assignedPort;
            this.StartListening (dsi, out assignedPort);

            // Create the start information
            ProcessStartInfo psi = new ProcessStartInfo (command.CommandString) { Arguments = command.CommandLineParameters, RedirectStandardOutput = true, RedirectStandardError = true, RedirectStandardInput = true, UseShellExecute = false };
            psi.EnvironmentVariables ["MONO_OPTIONS"] = string.Format ("--debug --debugger-agent=transport=dt_socket,address={0}:{1}", startArgs.Address, assignedPort);

            // Try to start the process
            this.process = Process.Start (psi);
            if (this.process == null) {
                this.EndSession ();
                return;
            }

            // Connect the stdout and stderr to the MonoDevelop's output
            this.ConnectOutput (this.process.StandardOutput, false);
            this.ConnectOutput (this.process.StandardError, true);

            // When process exits, end the session
            this.process.EnableRaisingEvents = true;
            this.process.Exited += delegate {
                this.EndSession ();
                this.process = null;
            };
        }
開發者ID:Monobjc,項目名稱:monobjc-monodevelop,代碼行數:35,代碼來源:MonobjcDebuggerSession.cs

示例6: OnRun

        protected override void OnRun (DebuggerStartInfo startInfo)
        {
            lock (gdbLock) {
                // Create a script to be run in a terminal
                string script = Path.GetTempFileName ();
                string ttyfile = Path.GetTempFileName ();
                string ttyfileDone = ttyfile + "_done";
                string tty;
                
                try {
                    File.WriteAllText (script, "tty > " + ttyfile + "\ntouch " + ttyfileDone + "\nsleep 10000d");
                    Mono.Unix.Native.Syscall.chmod (script, FilePermissions.ALLPERMS);
                    
                    console = Runtime.ProcessService.StartConsoleProcess (script, "", ".", ExternalConsoleFactory.Instance.CreateConsole (true), null);
                    DateTime tim = DateTime.Now;
                    while (!File.Exists (ttyfileDone)) {
                        System.Threading.Thread.Sleep (100);
                        if ((DateTime.Now - tim).TotalSeconds > 10)
                            throw new InvalidOperationException ("Console could not be created.");
                    }
                    tty = File.ReadAllText (ttyfile).Trim (' ','\n');
                } finally {
                    try {
                        if (File.Exists (script))
                            File.Delete (script);
                        if (File.Exists (ttyfile))
                            File.Delete (ttyfile);
                        if (File.Exists (ttyfileDone))
                            File.Delete (ttyfileDone);
                    } catch {
                        // Ignore
                    }
                }
                
                StartGdb ();
                
                // Initialize the terminal
                RunCommand ("-inferior-tty-set", Escape (tty));
                
                try {
                    RunCommand ("-file-exec-and-symbols", Escape (startInfo.Command));
                } catch {
                    FireTargetEvent (TargetEventType.TargetExited, null);
                    throw;
                }

                RunCommand ("-environment-cd", Escape (startInfo.WorkingDirectory));
                
                // Set inferior arguments
                if (!string.IsNullOrEmpty (startInfo.Arguments))
                    RunCommand ("-exec-arguments", startInfo.Arguments);
                
                currentProcessName = startInfo.Command + " " + startInfo.Arguments;
                
                CheckIsMonoProcess ();
                OnStarted ();
                
                RunCommand ("-exec-run");
            }
        }
開發者ID:telebovich,項目名稱:monodevelop,代碼行數:60,代碼來源:GdbSession.cs

示例7: OnRun

        protected override void OnRun(DebuggerStartInfo startInfo)
        {
            if (process != null)
                throw new InvalidOperationException("Already debugging!");

            var dsi = (MonobjcDebuggerStartInfo) startInfo;
            var cmd = dsi.ExecutionCommand;

            StartListening(dsi);

            var psi = new System.Diagnostics.ProcessStartInfo(cmd.CommandString) {
                Arguments = cmd.Arguments,
                RedirectStandardOutput = true,
                RedirectStandardError = true,
                RedirectStandardInput = true,
                UseShellExecute = false
            };
            psi.EnvironmentVariables["MONO_OPTIONS"] = String.Format("--debug --debugger-agent=transport=dt_socket,address={0}:{1}", dsi.Address, dsi.DebugPort);

            foreach (var kv in cmd.EnvironmentVariables)
                psi.EnvironmentVariables[kv.Key] = kv.Value;

            process = System.Diagnostics.Process.Start(psi);

            ConnectOutput(process.StandardOutput, false);
            ConnectOutput(process.StandardError, true);

            process.EnableRaisingEvents = true;
            process.Exited += delegate {
                EndSession();
                process = null;
            };
        }
開發者ID:robley,項目名稱:monodevelop-monobjc,代碼行數:33,代碼來源:MonobjcDebuggerSession.cs

示例8: OnRun

        protected override void OnRun (DebuggerStartInfo startInfo)
        {
            started = true;
            MonoDebuggerStartInfo info = (MonoDebuggerStartInfo) startInfo;
            controller.StartDebugger (info);
            InitMdbVersion (info.MonoPrefix);
            controller.DebuggerServer.Run (info, Options);
        }
開發者ID:transformersprimeabcxyz,項目名稱:monodevelop-1,代碼行數:8,代碼來源:MonoDebuggerSession.cs

示例9: OnRun

        protected override void OnRun (DebuggerStartInfo startInfo)
        {
            var dsi = (IPhoneDebuggerStartInfo) startInfo;
            var cmd = dsi.ExecutionCommand;
            if (cmd.Simulator)
                StartSimulatorProcess (cmd);
            StartListening (dsi);
        }
開發者ID:transformersprimeabcxyz,項目名稱:monodevelop-1,代碼行數:8,代碼來源:IPhoneDebuggerSession.cs

示例10: OnRun

        protected override void OnRun(DebuggerStartInfo startInfo)
        {
            var dsi = (CemonoDebuggerStartInfo)startInfo;

            int debugPort;
            StartListening(dsi, out debugPort);

            // Start process
        }
開發者ID:samneirinck,項目名稱:cemono,代碼行數:9,代碼來源:CemonoSoftDebuggerSession.cs

示例11: OnRun

        protected override void OnRun(DebuggerStartInfo startInfo)
        {
            var dsi = (SoftDebuggerStartInfo)startInfo;
            if (dsi.StartArgs is SoftDebuggerConnectArgs)
                base.StartConnecting(dsi);
            else if (dsi.StartArgs is SoftDebuggerListenArgs)
                base.StartListening(dsi);
            else
                throw new NotImplementedException();
        }
開發者ID:cg123,項目名稱:xenko,代碼行數:10,代碼來源:XenkoRemoteSoftDebuggerSession.cs

示例12: CreateDebuggerStartInfo

        public override DebuggerStartInfo CreateDebuggerStartInfo (ExecutionCommand command)
        {
            NativeExecutionCommand pec = (NativeExecutionCommand) command;
            DebuggerStartInfo startInfo = new DebuggerStartInfo ();
            startInfo.Command = pec.Command;
            startInfo.Arguments = pec.Arguments;
            startInfo.WorkingDirectory = pec.WorkingDirectory;
            if (pec.EnvironmentVariables.Count > 0) {
                foreach (KeyValuePair<string,string> val in pec.EnvironmentVariables)
                    startInfo.EnvironmentVariables [val.Key] = val.Value;
            }
            return startInfo;
        }
開發者ID:llucenic,項目名稱:MonoDevelop.Debugger.Gdb.D,代碼行數:13,代碼來源:GdbSessionFactory.cs

示例13: OnRun

        protected override void OnRun (DebuggerStartInfo startInfo)
        {
            if (exited)
                throw new InvalidOperationException ("Already exited");
            
            var dsi = (SoftDebuggerStartInfo) startInfo;
            var runtime = Path.Combine (Path.Combine (dsi.MonoRuntimePrefix, "bin"), "mono");
            RegisterUserAssemblies (dsi.UserAssemblyNames);
            
            var psi = new System.Diagnostics.ProcessStartInfo (runtime) {
                Arguments = string.Format ("\"{0}\" {1}", dsi.Command, dsi.Arguments),
                WorkingDirectory = dsi.WorkingDirectory,
                RedirectStandardOutput = true,
                RedirectStandardError = true,
                UseShellExecute = false,
                CreateNoWindow = true,
            };
            
            LaunchOptions options = null;
            
            if (dsi.UseExternalConsole && dsi.ExternalConsoleLauncher != null) {
                options = new LaunchOptions ();
                options.CustomTargetProcessLauncher = dsi.ExternalConsoleLauncher;
                psi.RedirectStandardOutput = false;
                psi.RedirectStandardError = false;
            }

            var sdbLog = Environment.GetEnvironmentVariable ("MONODEVELOP_SDB_LOG");
            if (!String.IsNullOrEmpty (sdbLog)) {
                options = options ?? new LaunchOptions ();
                options.AgentArgs = string.Format ("loglevel=1,logfile='{0}'", sdbLog);
            }
            
            foreach (var env in dsi.MonoRuntimeEnvironmentVariables)
                psi.EnvironmentVariables[env.Key] = env.Value;
            
            foreach (var env in startInfo.EnvironmentVariables)
                psi.EnvironmentVariables[env.Key] = env.Value;
            
            if (!String.IsNullOrEmpty (dsi.LogMessage))
                OnDebuggerOutput (false, dsi.LogMessage + "\n");

            OnConnecting (VirtualMachineManager.BeginLaunch (psi, HandleCallbackErrors (delegate (IAsyncResult ar) {
                    HandleConnection (VirtualMachineManager.EndLaunch (ar));
                }),
                options
            ));
        }
開發者ID:pgoron,項目名稱:monodevelop,代碼行數:48,代碼來源:SoftDebuggerSession.cs

示例14: OnRun

        protected override void OnRun (DebuggerStartInfo startInfo)
        {
            var mfStartInfo = startInfo as MicroFrameworkDebuggerStartInfo;
            if (mfStartInfo == null)//This should never happen...
                throw new InvalidOperationException ();
            var command = mfStartInfo.MFCommand;
            var portDefinition = ((MicroFrameworkExecutionTarget)command.Target).PortDefinition;
            using (var deployEngine = new Engine (portDefinition)) {
                deployEngine.Start ();

                string newCommand = "/CorDebug_DeployDeviceName:" + portDefinition.PersistName;

                var listOfAseemblies = new ArrayList ();

                //TODO: Check if this is robust enough will "be" and "le" really always be in output folder?
                OutputDirectory = command.OutputDirectory;
                string dir = command.OutputDirectory;
                if (deployEngine.IsTargetBigEndian)
                    dir = Path.Combine (dir, "be");
                else
                    dir = Path.Combine (dir, "le");

                string[] files = Directory.GetFiles (dir, "*.pe");
                foreach (var file in files) {
                    newCommand = "/load:" + file + " " + newCommand;
                    using (var fs = new FileStream (file, FileMode.Open)) {
                        byte[] data = new byte[fs.Length];
                        fs.Read (data, 0, data.Length);
                        listOfAseemblies.Add (data);
                    }
                }
                startInfo.Command = newCommand;
                deployEngine.Deployment_Execute (listOfAseemblies, false, (str) => OnDebuggerOutput (false, "Deploy: " + str + Environment.NewLine));
                deployEngine.RebootDevice (Engine.RebootOption.RebootClrWaitForDebugger);
            }
            VsPackage.MessageCentre.Session = this;
            try {
                CorDebugProcess process = CorDebugProcess.CreateProcess (new DebugPortSupplier ().FindPort ("USB"), startInfo.Command);
                process.StartDebugging (this, false);
                // StartDebugging() will either get a connected device into a debuggable state and start the dispatch thread, or throw.
            } catch (ProcessExitException) {
                VsPackage.MessageCentre.DeploymentMsg (DiagnosticStrings.InitializeProcessFailedProcessDied);
            } catch (Exception ex) {
                VsPackage.MessageCentre.DeploymentMsg (DiagnosticStrings.InitializeProcessFailed);
                VsPackage.MessageCentre.InternalErrorMsg (false, ex.Message);
            }
        }
開發者ID:Roddoric,項目名稱:Monkey.Robotics,代碼行數:47,代碼來源:MicroFrameworkDebuggerSession.cs

示例15: OnRun

        protected override void OnRun(DebuggerStartInfo startInfo)
        {
            try{
                if (startInfo == null) {
                    EndSession ();
                    return;
                }

                base.OnRun (startInfo);
            }catch (Exception ex) {
                Gtk.Application.Invoke (delegate {
                    using (var md = new MessageDialog (null, DialogFlags.Modal, MessageType.Info, ButtonsType.Ok, ex.Message)) {
                        md.Title = "CustomSoftDebuggerSession";
                        md.Run ();
                        md.Destroy ();
                    }
                });
            }
        }
開發者ID:Clancey,項目名稱:SSHDebugger,代碼行數:19,代碼來源:clsSSHSoftDebuggerSession.cs


注:本文中的Mono.Debugging.Client.DebuggerStartInfo類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。