• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# Soft.SoftDebuggerStartInfo类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中Mono.Debugging.Soft.SoftDebuggerStartInfo的典型用法代码示例。如果您正苦于以下问题:C# SoftDebuggerStartInfo类的具体用法?C# SoftDebuggerStartInfo怎么用?C# SoftDebuggerStartInfo使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



SoftDebuggerStartInfo类属于Mono.Debugging.Soft命名空间,在下文中一共展示了SoftDebuggerStartInfo类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: CreateDebuggerStartInfo

		public DebuggerStartInfo CreateDebuggerStartInfo (ExecutionCommand command)
		{
			var cmd = (AspNetExecutionCommand) command;
			
			var runtime = (MonoTargetRuntime)cmd.TargetRuntime;
			var startInfo = new SoftDebuggerStartInfo (runtime.Prefix, runtime.EnvironmentVariables) {
				WorkingDirectory = cmd.BaseDirectory,
				Arguments = cmd.XspParameters.GetXspParameters ().Trim (),
			};
			
			var xspName = AspNetExecutionHandler.GetXspName (cmd);
			
			FilePath fxDir = GetFxDir (runtime, cmd.ClrVersion);
			FilePath xspPath = fxDir.Combine (xspName).ChangeExtension (".exe");
			
			//no idea why xsp is sometimes relocated to a "winhack" dir on Windows
			if (MonoDevelop.Core.PropertyService.IsWindows && !File.Exists (xspPath)) {
				var winhack = fxDir.Combine ("winhack");
				if (Directory.Exists (winhack))
					xspPath = winhack.Combine (xspName).ChangeExtension (".exe");
			}
			
			if (!File.Exists (xspPath))
				throw new UserException (GettextCatalog.GetString (
					"The \"{0}\" web server cannot be started. Please ensure that it is installed.", xspName), null);
			
			startInfo.Command = xspPath;
			
			string error;
			startInfo.UserAssemblyNames = SoftDebuggerEngine.GetAssemblyNames (cmd.UserAssemblyPaths, out error);
			startInfo.LogMessage = error;
			
			return startInfo;
		}
开发者ID:Tak,项目名称:monodevelop-novell,代码行数:34,代码来源:AspNetSoftDebuggerEngine.cs


示例2: CreateDebuggerStartInfo

		public DebuggerStartInfo CreateDebuggerStartInfo (ExecutionCommand c)
		{
			var cmd = (DotNetExecutionCommand) c;
			var runtime = (MonoTargetRuntime)cmd.TargetRuntime;
			var dsi = new SoftDebuggerStartInfo (runtime.Prefix, runtime.EnvironmentVariables) {
				Command = cmd.Command,
				Arguments = cmd.Arguments,
				WorkingDirectory = cmd.WorkingDirectory,
			};
			
			string error;
			dsi.UserAssemblyNames = GetAssemblyNames (cmd.UserAssemblyPaths, out error);
			dsi.LogMessage = error;
			
			foreach (KeyValuePair<string,string> var in cmd.EnvironmentVariables)
				dsi.EnvironmentVariables [var.Key] = var.Value;
			
			var varsCopy = new Dictionary<string, string> (cmd.EnvironmentVariables);
			dsi.ExternalConsoleLauncher = delegate (System.Diagnostics.ProcessStartInfo info) {
				IProcessAsyncOperation oper;
				oper = Runtime.ProcessService.StartConsoleProcess (info.FileName, info.Arguments, info.WorkingDirectory,
					varsCopy, ExternalConsoleFactory.Instance.CreateConsole (dsi.CloseExternalConsoleOnExit), null);
				return new ProcessAdapter (oper, Path.GetFileName (info.FileName));
			};

			return dsi;
		}
开发者ID:transformersprimeabcxyz,项目名称:monodevelop-1,代码行数:27,代码来源:SoftDebuggerEngine.cs


示例3: CreateDebuggerStartInfo

		public override DebuggerStartInfo CreateDebuggerStartInfo (ExecutionCommand c)
		{
			var cmd = (DotNetExecutionCommand) c;
			var runtime = (MonoTargetRuntime)cmd.TargetRuntime;
			var dsi = new SoftDebuggerStartInfo (runtime.Prefix, runtime.EnvironmentVariables) {
				Command = cmd.Command,
				Arguments = cmd.Arguments,
				WorkingDirectory = cmd.WorkingDirectory,
			};
			
			SetUserAssemblyNames (dsi, cmd.UserAssemblyPaths);
			
			foreach (KeyValuePair<string,string> var in cmd.EnvironmentVariables)
				dsi.EnvironmentVariables [var.Key] = var.Value;
			
			var varsCopy = new Dictionary<string, string> (cmd.EnvironmentVariables);
			var startArgs = (SoftDebuggerLaunchArgs) dsi.StartArgs;
			startArgs.ExternalConsoleLauncher = delegate (System.Diagnostics.ProcessStartInfo info) {
				ProcessAsyncOperation oper;
				oper = Runtime.ProcessService.StartConsoleProcess (info.FileName, info.Arguments, info.WorkingDirectory,
					ExternalConsoleFactory.Instance.CreateConsole (dsi.CloseExternalConsoleOnExit), varsCopy);
				return new ProcessAdapter (oper, Path.GetFileName (info.FileName));
			};
			startArgs.MonoExecutableFileName = runtime.MonoRuntimeInfo.Force64or32bit.HasValue ? runtime.MonoRuntimeInfo.Force64or32bit.Value ? "mono64" : "mono32" : "mono";
			return dsi;
		}
开发者ID:zenek-y,项目名称:monodevelop,代码行数:26,代码来源:SoftDebuggerEngine.cs


示例4: CreateDebuggerStartInfo

		public DebuggerStartInfo CreateDebuggerStartInfo (ExecutionCommand command)
		{
			var cmd = (AspNetExecutionCommand) command;
			
			var runtime = (MonoTargetRuntime)cmd.TargetRuntime;
			var startInfo = new SoftDebuggerStartInfo (runtime.Prefix, runtime.EnvironmentVariables) {
				WorkingDirectory = cmd.BaseDirectory,
				Arguments = cmd.XspParameters.GetXspParameters ().Trim (),
			};
			
			FilePath prefix = runtime.Prefix;
			if (MonoDevelop.Core.PropertyService.IsWindows) {
				startInfo.Command = (cmd.ClrVersion == ClrVersion.Net_1_1)
					? prefix.Combine ("lib", "mono", "1.0", "winhack", "xsp.exe")
					: prefix.Combine ("lib", "mono", "2.0", "winhack", "xsp2.exe");
			}
			else {
				startInfo.Command = (cmd.ClrVersion == ClrVersion.Net_1_1)
					? prefix.Combine ("lib", "mono", "1.0", "xsp.exe")
					: prefix.Combine ("lib", "mono", "2.0", "xsp2.exe");
			}
			
			string error;
			startInfo.UserAssemblyNames = SoftDebuggerEngine.GetAssemblyNames (cmd.UserAssemblyPaths, out error);
			startInfo.LogMessage = error;
			
			return startInfo;
		}
开发者ID:pgoron,项目名称:monodevelop,代码行数:28,代码来源:AspNetSoftDebuggerEngine.cs


示例5: CreateDebuggerStartInfo

		public DebuggerStartInfo CreateDebuggerStartInfo (ExecutionCommand command)
		{
			var cmd = (AspNetExecutionCommand) command;
			var evars = new Dictionary<string, string>(cmd.EnvironmentVariables);
			var runtime = (MonoTargetRuntime) cmd.TargetRuntime;

			foreach (var v in runtime.EnvironmentVariables)
			{
				if (!evars.ContainsKey (v.Key))
					evars.Add (v.Key, v.Value);
			}
			
			var startInfo = new SoftDebuggerStartInfo (runtime.Prefix, evars) {
				WorkingDirectory = cmd.BaseDirectory,
				Arguments = cmd.XspParameters.GetXspParameters ().Trim (),
			};
			
			var xspName = AspNetExecutionHandler.GetXspName (cmd);
			
			FilePath fxDir = GetFxDir (runtime, cmd.ClrVersion);
			FilePath xspPath = fxDir.Combine (xspName).ChangeExtension (".exe");
			
			//no idea why xsp is sometimes relocated to a "winhack" dir on Windows
			if (MonoDevelop.Core.Platform.IsWindows && !File.Exists (xspPath)) {
				var winhack = fxDir.Combine ("winhack");
				if (Directory.Exists (winhack))
					xspPath = winhack.Combine (xspName).ChangeExtension (".exe");
			}
			
			if (!File.Exists (xspPath))
				throw new UserException (GettextCatalog.GetString (
					"The \"{0}\" web server cannot be started. Please ensure that it is installed.", xspName), null);
			
			startInfo.Command = xspPath;
			SoftDebuggerEngine.SetUserAssemblyNames (startInfo, cmd.UserAssemblyPaths);
			
			return startInfo;
		}
开发者ID:telebovich,项目名称:monodevelop,代码行数:38,代码来源:AspNetSoftDebuggerEngine.cs


示例6: StartListening

		/// <summary>Starts the debugger listening for a connection over TCP/IP</summary>
		protected void StartListening (SoftDebuggerStartInfo dsi, out int assignedDebugPort)
		{
			int cp;
			StartListening (dsi, out assignedDebugPort, out cp);
		}
开发者ID:rajeshpillai,项目名称:monodevelop,代码行数:6,代码来源:SoftDebuggerSession.cs


示例7: Run

		public static void Run(FileInfo file)
		{
			lock (_lock)
			{
				EnsureCreated();

				CurrentExecutable = file;
				CurrentAddress = null;
				CurrentPort = -1;

				_debuggeeKilled = false;
				_kind = SessionKind.Launched;

				var info = new SoftDebuggerStartInfo(Configuration.Current.RuntimePrefix,
					new Dictionary<string, string>(EnvironmentVariables))
				{
					Command = file.FullName,
					Arguments = Arguments,
					WorkingDirectory = WorkingDirectory,
					StartArgs =
					{
						MaxConnectionAttempts = Configuration.Current.MaxConnectionAttempts,
						TimeBetweenConnectionAttempts = Configuration.Current.ConnectionAttemptInterval
					}
				};

				// We need to ignore `SIGINT` while we start the inferior
				// process so that it inherits that signal disposition.
				CommandLine.UnsetControlCHandler();

				_session.Run(info, Options);

				CommandLine.InferiorExecuting = true;
			}
		}
开发者ID:nooner2014,项目名称:vscode-mono-debug,代码行数:35,代码来源:Debugger.cs


示例8: DebuggerInfo

        public SoftDebuggerStartInfo DebuggerInfo(int consolePort = -1)
        {
            try
            {

                IPAddress[] addresslist = Dns.GetHostAddresses(LocalHost);

                var	startArgs = new SoftDebuggerConnectArgs ("", addresslist[0], (int)LocalTunnelPort, consolePort) {
                        //infinite connection retries (user can cancel), 800ms between them
                        TimeBetweenConnectionAttempts = 800,
                        MaxConnectionAttempts = -1,
                };

                var dsi = new SoftDebuggerStartInfo (startArgs) {
                        Command = "",
                        Arguments = ""
                };

                if (Terminal != null) Terminal.SSH.WriteLine ("Configuring debugger {0}:{1}",addresslist[0], (int)LocalTunnelPort);

                return dsi;

            }
            catch (Exception ex)
            {

                if (Terminal != null) {
                    Terminal.SSH.WriteLine ("SoftDebuggerStartInfo Error {0}", ex.Message);
                } else {
                    Gtk.Application.Invoke (delegate {
                        using (var md = new MessageDialog (null, DialogFlags.Modal, MessageType.Info, ButtonsType.Ok, String.Format("SoftDebuggerStartInfo Error {0}", ex.Message))) {
                            md.Title = "ProcessScript";
                            md.Run ();
                            md.Destroy ();
                        }
                    });
                }
                return null;
            }
        }
开发者ID:Clancey,项目名称:SSHDebugger,代码行数:40,代码来源:clsHost.cs


示例9: RegisterUserAssemblies

		void RegisterUserAssemblies (SoftDebuggerStartInfo dsi)
		{
			if (Options.ProjectAssembliesOnly && dsi.UserAssemblyNames != null) {
				assemblyFilters = new List<AssemblyMirror> ();
				userAssemblyNames = dsi.UserAssemblyNames.Select (x => x.ToString ()).ToList ();
			}
			
			assemblyPathMap = dsi.AssemblyPathMap;
			if (assemblyPathMap == null)
				assemblyPathMap = new Dictionary<string, string> ();
		}
开发者ID:rajeshpillai,项目名称:monodevelop,代码行数:11,代码来源:SoftDebuggerSession.cs


示例10: InitForRemoteSession

		void InitForRemoteSession (SoftDebuggerStartInfo dsi, out IPEndPoint dbgEP, out IPEndPoint conEP)
		{
			if (remoteProcessName != null)
				throw new InvalidOperationException ("Cannot initialize connection more than once");
			
			var args = (SoftDebuggerRemoteArgs) dsi.StartArgs;
			
			remoteProcessName = args.AppName;
			
			RegisterUserAssemblies (dsi);
			
			dbgEP = new IPEndPoint (args.Address, args.DebugPort);
			conEP = args.RedirectOutput? new IPEndPoint (args.Address, args.OutputPort) : null;
			
			if (!String.IsNullOrEmpty (dsi.LogMessage))
				LogWriter (false, dsi.LogMessage + "\n");
		}
开发者ID:rajeshpillai,项目名称:monodevelop,代码行数:17,代码来源:SoftDebuggerSession.cs


示例11: StartConnecting

		/// <summary>Starts the debugger connecting to a remote IP</summary>
		protected void StartConnecting (SoftDebuggerStartInfo dsi, int maxAttempts, int timeBetweenAttempts)
		{	
			if (timeBetweenAttempts < 0 || timeBetweenAttempts > 10000)
				throw new ArgumentException ("timeBetweenAttempts");
			
			IPEndPoint dbgEP, conEP;
			InitForRemoteSession (dsi, out dbgEP, out conEP);
			
			AsyncCallback callback = null;
			int attemptNumber = 0;
			callback = delegate (IAsyncResult ar) {
				try {
					ConnectionStarted (VirtualMachineManager.EndConnect (ar));
					return;
				} catch (Exception ex) {
					attemptNumber++;
					if (!ShouldRetryConnection (ex, attemptNumber) || attemptNumber == maxAttempts || Exited) {
						OnConnectionError (ex);
						return;
					}
				}
				try {
					if (timeBetweenAttempts > 0)
						System.Threading.Thread.Sleep (timeBetweenAttempts);
					
					ConnectionStarting (VirtualMachineManager.BeginConnect (dbgEP, conEP, callback), dsi, false, attemptNumber);
					
				} catch (Exception ex2) {
					OnConnectionError (ex2);
				}
			};
			
			ConnectionStarting (VirtualMachineManager.BeginConnect (dbgEP, conEP, callback), dsi, false, 0);
		}
开发者ID:rajeshpillai,项目名称:monodevelop,代码行数:35,代码来源:SoftDebuggerSession.cs


示例12: StartLaunching

		void StartLaunching (SoftDebuggerStartInfo dsi)
		{
			var args = (SoftDebuggerLaunchArgs) dsi.StartArgs;
			var runtime = Path.Combine (Path.Combine (args.MonoRuntimePrefix, "bin"), "mono");
			RegisterUserAssemblies (dsi);
			
			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 && args.ExternalConsoleLauncher != null) {
				options = new LaunchOptions ();
				options.CustomTargetProcessLauncher = args.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 args.MonoRuntimeEnvironmentVariables)
				psi.EnvironmentVariables[env.Key] = env.Value;
			
			foreach (var env in dsi.EnvironmentVariables)
				psi.EnvironmentVariables[env.Key] = env.Value;
			
			if (!String.IsNullOrEmpty (dsi.LogMessage))
				OnDebuggerOutput (false, dsi.LogMessage + "\n");
			
			var callback = HandleConnectionCallbackErrors ((IAsyncResult ar) => {
				ConnectionStarted (VirtualMachineManager.EndLaunch (ar));
			});
			ConnectionStarting (VirtualMachineManager.BeginLaunch (psi, callback, options), dsi, true, 0);
		}
开发者ID:rajeshpillai,项目名称:monodevelop,代码行数:44,代码来源:SoftDebuggerSession.cs


示例13: StartConnection

		void StartConnection (SoftDebuggerStartInfo dsi)
		{
			this.startArgs = dsi.StartArgs;
			
			RegisterUserAssemblies (dsi);
			
			if (!String.IsNullOrEmpty (dsi.LogMessage))
				LogWriter (false, dsi.LogMessage + "\n");
			
			AsyncCallback callback = null;
			int attemptNumber = 0;
			int maxAttempts = startArgs.MaxConnectionAttempts;
			int timeBetweenAttempts = startArgs.TimeBetweenConnectionAttempts;
			callback = delegate (IAsyncResult ar) {
				try {
					string appName;
					VirtualMachine vm;
					startArgs.ConnectionProvider.EndConnect (ar, out vm, out appName);
					this.remoteProcessName = appName;
					ConnectionStarted (vm);
					return;
				} catch (Exception ex) {
					attemptNumber++;
					if (!ShouldRetryConnection (ex, attemptNumber)
						|| !startArgs.ConnectionProvider.ShouldRetryConnection (ex)
						|| attemptNumber == maxAttempts
						|| Exited)
					{
						OnConnectionError (ex);
						return;
					}
				}
				try {
					if (timeBetweenAttempts > 0)
						System.Threading.Thread.Sleep (timeBetweenAttempts);
					ConnectionStarting (startArgs.ConnectionProvider.BeginConnect (dsi, callback), dsi, false, 0);
				} catch (Exception ex2) {
					OnConnectionError (ex2);
				}
			};
			//the "listening" value is never used, pass a dummy value
			ConnectionStarting (startArgs.ConnectionProvider.BeginConnect (dsi, callback), dsi, false, 0);
		}
开发者ID:rajeshpillai,项目名称:monodevelop,代码行数:43,代码来源:SoftDebuggerSession.cs


示例14: StartConnecting

		protected void StartConnecting (SoftDebuggerStartInfo dsi)
		{
			var args = (SoftDebuggerConnectArgs) dsi.StartArgs;
			StartConnecting (dsi, args.MaxConnectionAttempts, args.TimeBetweenConnectionAttempts);
		}
开发者ID:famousthom,项目名称:monodevelop,代码行数:5,代码来源:SoftDebuggerSession.cs


示例15: SetUserAssemblyNames

		public static void SetUserAssemblyNames (SoftDebuggerStartInfo dsi, IList<string> files)
		{
			if (files == null || files.Count == 0)
				return;
			
			var pathMap = new Dictionary<string, string> ();
			var names = new List<AssemblyName> ();
			
			foreach (var file in files) {
				if (!File.Exists (file)) {
					dsi.LogMessage = GettextCatalog.GetString ("User assembly '{0}' is missing. " +
						"Debugger will now debug all code, not just user code.", file);
					continue;
				}
				
				try {
					var asm = Mono.Cecil.AssemblyDefinition.ReadAssembly (file);
					if (string.IsNullOrEmpty (asm.Name.Name))
						throw new InvalidOperationException ("Assembly has no assembly name");
					
					AssemblyName name = new AssemblyName (asm.Name.FullName);
					if (!pathMap.ContainsKey (asm.Name.FullName))
						pathMap.Add (asm.Name.FullName, file);
					names.Add (name);
				} catch (Exception ex) {
					dsi.LogMessage = GettextCatalog.GetString ("Could not get assembly name for user assembly '{0}'. " +
						"Debugger will now debug all code, not just user code.", file);
					LoggingService.LogError ("Error getting assembly name for user assembly '" + file + "'", ex);
					continue;
				}
			}
			
			dsi.UserAssemblyNames = names;
			dsi.AssemblyPathMap = pathMap;
		}
开发者ID:pabloescribanoloza,项目名称:monodevelop,代码行数:35,代码来源:SoftDebuggerEngine.cs



注:本文中的Mono.Debugging.Soft.SoftDebuggerStartInfo类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# ILASM.CodeGen类代码示例发布时间:2022-05-26
下一篇:
C# Evaluation.EvaluationContext类代码示例发布时间:2022-05-26
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap