Mono.Debugger.Soft.TypeMirror.GetSourceFiles C# (CSharp) Method

GetSourceFiles() public method

public GetSourceFiles ( ) : string[]
return string[]
		public string[] GetSourceFiles () {
			return GetSourceFiles (false);
		}

Same methods

TypeMirror::GetSourceFiles ( bool return_full_paths ) : string[]

Usage Example

Esempio n. 1
0
		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);
		}
All Usage Examples Of Mono.Debugger.Soft.TypeMirror::GetSourceFiles