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); }
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); }
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; }
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); }