public void EETypeTest() { using DataTarget dt = TestTargets.AppDomains.LoadFullDump(); ClrRuntime runtime = dt.ClrVersions.Single().CreateRuntime(); ClrHeap heap = runtime.Heap; HashSet <ulong> methodTables = (from obj in heap.EnumerateObjectAddresses() let type = heap.GetObjectType(obj) where !type.IsFree select heap.GetMethodTable(obj)).Unique(); Assert.DoesNotContain(0ul, methodTables); foreach (ulong mt in methodTables) { ClrType type = heap.GetTypeByMethodTable(mt); ulong eeclass = heap.GetEEClassByMethodTable(mt); Assert.NotEqual(0ul, eeclass); Assert.NotEqual(0ul, heap.GetMethodTableByEEClass(eeclass)); } }
/// <summary> /// Retrieves the EEClass from the given MethodTable. EEClasses do not exist on /// .Net Native. /// </summary> /// <param name="methodTable">The MethodTable to get the EEClass from.</param> /// <returns> /// The EEClass for the given MethodTable, 0 if methodTable is invalid or /// does not exist. /// </returns> /// <inheritdoc /> public ulong GetEEClassByMethodTable(ulong methodTable) => Heap.GetEEClassByMethodTable(methodTable);