Author: lluis
Date: 2006-11-13 13:11:22 -0500 (Mon, 13 Nov 2006)
New Revision: 67770
Modified:
trunk/heap-shot/ChangeLog
trunk/heap-shot/HeapShot/ReferenceTreeReport.cs
Log:
2006-11-13 Lluis Sanchez Gual <[EMAIL PROTECTED]>
* HeapShot/ReferenceTreeReport.cs: Track api changes.
Modified: trunk/heap-shot/ChangeLog
===================================================================
--- trunk/heap-shot/ChangeLog 2006-11-13 17:07:15 UTC (rev 67769)
+++ trunk/heap-shot/ChangeLog 2006-11-13 18:11:22 UTC (rev 67770)
@@ -1,3 +1,7 @@
+2006-11-13 Lluis Sanchez Gual <[EMAIL PROTECTED]>
+
+ * HeapShot/ReferenceTreeReport.cs: Track api changes.
+
2006-11-13 Lluis Sanchez Gual <[EMAIL PROTECTED]>
* profiler/outfile-writer.h:
Modified: trunk/heap-shot/HeapShot/ReferenceTreeReport.cs
===================================================================
--- trunk/heap-shot/HeapShot/ReferenceTreeReport.cs 2006-11-13 17:07:15 UTC
(rev 67769)
+++ trunk/heap-shot/HeapShot/ReferenceTreeReport.cs 2006-11-13 18:11:22 UTC
(rev 67770)
@@ -85,12 +85,17 @@
}
if (type != null) {
+ int ntype = omap.GetTypeFromName (type);
+ if (ntype == -1) {
+ Console.WriteLine ("Type not found: " +
type);
+ return;
+ }
if (roots) {
- PrintRoots (omap, type, maxlevels);
+ PrintRoots (omap, ntype, maxlevels);
} else {
// Show the tree for a type
- ReferenceNode nod = new ReferenceNode
(omap, type, inverse);
- foreach (int obj in
omap.GetObjectsByType (type)) {
+ ReferenceNode nod = new ReferenceNode
(omap, ntype, inverse);
+ foreach (int obj in
omap.GetObjectsByType (ntype)) {
nod.AddReference (obj);
}
nod.Print (maxlevels);
@@ -108,13 +113,13 @@
}
}
- void PrintRoots (ObjectMapReader omap, string typeName, int
maxlevels)
+ void PrintRoots (ObjectMapReader omap, int type, int maxlevels)
{
List<int> path = new List<int> ();
Dictionary<int,List<int>> roots = new
Dictionary<int,List<int>> ();
Dictionary<int,int> visited = new Dictionary<int,int>
();
- foreach (int obj in omap.GetObjectsByType (typeName)) {
+ foreach (int obj in omap.GetObjectsByType (type)) {
FindRoot (omap, visited, path, roots, obj);
visited.Clear ();
}
_______________________________________________
Mono-patches maillist - [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches