Currently I could get all the objects that are present in heap using the below code using ClrMD. Is it posible to get only the set of objects that are used in the target process(i.e only the objects that are WITHIN to the souce code of the target process).
var types = heap.EnumerateObjectAddresses()
.GroupBy(obj => heap.GetObjectType(obj).Name)
.Select(group => new { Key = group.Key, Count = group.Count() })
.OrderBy(type => type.Count);
foreach (var type in types)
Console.WriteLine("{0} {1}", type.Key, type.Count);
Console.ReadLine();