当前位置: 首页>>代码示例>>C#>>正文


C# TypeMirror.GetSourceFiles方法代码示例

本文整理汇总了C#中Mono.Debugger.Soft.TypeMirror.GetSourceFiles方法的典型用法代码示例。如果您正苦于以下问题:C# TypeMirror.GetSourceFiles方法的具体用法?C# TypeMirror.GetSourceFiles怎么用?C# TypeMirror.GetSourceFiles使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Mono.Debugger.Soft.TypeMirror的用法示例。


在下文中一共展示了TypeMirror.GetSourceFiles方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: ResolveBreakpoints

		void ResolveBreakpoints (TypeMirror t)
		{
			string typeName = t.FullName;
			types [typeName] = t;
			
			/* Handle pending breakpoints */
			
			var resolved = new List<BreakEvent> ();
			
			//get the source file paths
			//full paths, from GetSourceFiles (true), are only supported by sdb protocol 2.2 and later
			string[] sourceFiles;
			if (useFullPaths) {
				sourceFiles = t.GetSourceFiles (true);
			} else {
				sourceFiles = t.GetSourceFiles ();
				
				//HACK: if mdb paths are windows paths but the sdb agent is on unix, it won't map paths to filenames correctly
				if (IsWindows) {
					for (int i = 0; i < sourceFiles.Length; i++) {
						string s = sourceFiles[i];
						if (s != null && !s.StartsWith ("/"))
							sourceFiles[i] = System.IO.Path.GetFileName (s);
					}
				}
			}
			
			foreach (string s in sourceFiles) {
				List<TypeMirror> typesList;
				
				if (source_to_type.TryGetValue (s, out typesList)) {
					typesList.Add (t);
				} else {
					typesList = new List<TypeMirror> ();
					typesList.Add (t);
					source_to_type[s] = typesList;
				}
				
				foreach (var bp in pending_bes.OfType<Breakpoint> ()) {
					if (PathComparer.Compare (PathToFileName (bp.FileName), s) == 0) {
						Location l = GetLocFromType (t, s, bp.Line);
						if (l != null) {
							OnDebuggerOutput (false, string.Format ("Resolved pending breakpoint at '{0}:{1}' to {2}:{3}.\n",
							                                        s, bp.Line, l.Method.FullName, l.ILOffset));
							ResolvePendingBreakpoint (bp, l);
							resolved.Add (bp);
						} else {
							OnDebuggerOutput (true, string.Format ("Could not insert pending breakpoint at '{0}:{1}'. " +
								"Perhaps the source line does not contain any statements, or the source does not correspond " +
								"to the current binary.\n", s, bp.Line));
						}
					}
				}
				
				foreach (var be in resolved)
					pending_bes.Remove (be);
				resolved.Clear ();
			}
			
			//handle pending catchpoints
			
			foreach (var cp in pending_bes.OfType<Catchpoint> ()) {
				if (cp.ExceptionName == typeName) {
					ResolvePendingCatchpoint (cp, t);
					resolved.Add (cp);
				}
			}
			foreach (var be in resolved)
				pending_bes.Remove (be);
		}
开发者ID:trustme,项目名称:monodevelop,代码行数:70,代码来源:SoftDebuggerSession.cs

示例2: ResolveBreakpoints

		void ResolveBreakpoints (TypeMirror t)
		{
			string typeName = t.FullName;
			types [typeName] = t;
			
			/* Handle pending breakpoints */
			
			var resolved = new List<BreakInfo> ();
			
			//get the source file paths
			//full paths, from GetSourceFiles (true), are only supported by sdb protocol 2.2 and later
			string[] sourceFiles;
			if (useFullPaths) {
				sourceFiles = t.GetSourceFiles (true);
			} else {
				sourceFiles = t.GetSourceFiles ();
				
				//HACK: if mdb paths are windows paths but the sdb agent is on unix, it won't map paths to filenames correctly
				if (IsWindows) {
					for (int i = 0; i < sourceFiles.Length; i++) {
						string s = sourceFiles[i];
						if (s != null && !s.StartsWith ("/"))
							sourceFiles[i] = System.IO.Path.GetFileName (s);
					}
				}
			}
			
			for (int n=0; n<sourceFiles.Length; n++)
				sourceFiles[n] = NormalizePath (sourceFiles[n]);
			
			foreach (string s in sourceFiles) {
				List<TypeMirror> typesList;
				
				if (source_to_type.TryGetValue (s, out typesList)) {
					typesList.Add (t);
				} else {
					typesList = new List<TypeMirror> ();
					typesList.Add (t);
					source_to_type[s] = typesList;
				}
				
				foreach (var bi in pending_bes.Where (b => b.BreakEvent is Breakpoint)) {
					var bp = (Breakpoint) bi.BreakEvent;
					if (PathComparer.Compare (PathToFileName (bp.FileName), s) == 0) {
						bool inisideLoadedRange;
						Location l = GetLocFromType (t, s, bp.Line, out inisideLoadedRange);
						if (l != null) {
							OnDebuggerOutput (false, string.Format ("Resolved pending breakpoint at '{0}:{1}' to {2} [0x{3:x5}].\n",
							                                        s, l.LineNumber, l.Method.FullName, l.ILOffset));
							ResolvePendingBreakpoint (bi, l);
							resolved.Add (bi);
						} else {
							if (inisideLoadedRange) {
								bi.SetStatus (BreakEventStatus.Invalid, null);
							}
						}
					}
				}
				
				foreach (var be in resolved)
					pending_bes.Remove (be);
				resolved.Clear ();
			}
			
			//handle pending catchpoints
			
			foreach (var bi in pending_bes.Where (b => b.BreakEvent is Catchpoint)) {
				var cp = (Catchpoint) bi.BreakEvent;
				if (cp.ExceptionName == typeName) {
					ResolvePendingCatchpoint (bi, t);
					resolved.Add (bi);
				}
			}
			foreach (var be in resolved)
				pending_bes.Remove (be);
		}
开发者ID:hduregger,项目名称:monodevelop,代码行数:76,代码来源:SoftDebuggerSession.cs

示例3: ProcessType

		void ProcessType (TypeMirror t)
		{
			string typeName = t.FullName;

			if (types.ContainsKey (typeName))
				return;
			types [typeName] = t;

			//get the source file paths
			//full paths, from GetSourceFiles (true), are only supported by sdb protocol 2.2 and later
			string[] sourceFiles;
			if (useFullPaths) {
				sourceFiles = t.GetSourceFiles (true);
			} else {
				sourceFiles = t.GetSourceFiles ();
				
				//HACK: if mdb paths are windows paths but the sdb agent is on unix, it won't map paths to filenames correctly
				if (IsWindows) {
					for (int i = 0; i < sourceFiles.Length; i++) {
						string s = sourceFiles[i];
						if (s != null && !s.StartsWith ("/"))
							sourceFiles[i] = Path.GetFileName (s);
					}
				}
			}
			
			for (int n=0; n<sourceFiles.Length; n++)
				sourceFiles[n] = NormalizePath (sourceFiles[n]);

			foreach (string s in sourceFiles) {
				List<TypeMirror> typesList;
				
				if (source_to_type.TryGetValue (s, out typesList)) {
					typesList.Add (t);
				} else {
					typesList = new List<TypeMirror> ();
					typesList.Add (t);
					source_to_type[s] = typesList;
				}
			}

			type_to_source [t] = sourceFiles;
		}
开发者ID:rajeshpillai,项目名称:monodevelop,代码行数:43,代码来源:SoftDebuggerSession.cs

示例4: ResolveBreakpoints

		void ResolveBreakpoints (TypeMirror t)
		{
			string typeName = t.FullName;
			types [typeName] = t;
			
			/* Handle pending breakpoints */
			
			var resolved = new List<BreakEvent> ();
			
			foreach (string s in t.GetSourceFiles ()) {
				List<TypeMirror> typesList;
				
				if (source_to_type.TryGetValue (s, out typesList)) {
					typesList.Add (t);
				} else {
					typesList = new List<TypeMirror> ();
					typesList.Add (t);
					source_to_type[s] = typesList;
				}
				
				
				foreach (var bp in pending_bes.OfType<Breakpoint> ()) {
					if (System.IO.Path.GetFileName (bp.FileName) == s) {
						Location l = GetLocFromType (t, s, bp.Line);
						if (l != null) {
							OnDebuggerOutput (false, string.Format ("Resolved pending breakpoint at '{0}:{1}' to {2}:{3}.\n",
							                                        s, bp.Line, l.Method.FullName, l.ILOffset));
							ResolvePendingBreakpoint (bp, l);
							resolved.Add (bp);
						} else {
							OnDebuggerOutput (true, string.Format ("Could not insert pending breakpoint at '{0}:{1}'. " +
								"Perhaps the source line does not contain any statements, or the source does not correspond " +
								"to the current binary.\n", s, bp.Line));
						}
					}
				}
				
				foreach (var be in resolved)
					pending_bes.Remove (be);
				resolved.Clear ();
			}
			
			//handle pending catchpoints
			
			foreach (var cp in pending_bes.OfType<Catchpoint> ()) {
				if (cp.ExceptionName == typeName) {
					ResolvePendingCatchpoint (cp, t);
					resolved.Add (cp);
				}
			}
			foreach (var be in resolved)
				pending_bes.Remove (be);
		}
开发者ID:pgoron,项目名称:monodevelop,代码行数:53,代码来源:SoftDebuggerSession.cs


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