diff --git a/src/Microsoft.Diagnostics.Runtime/DacImplementation/DacTypeHelpers.cs b/src/Microsoft.Diagnostics.Runtime/DacImplementation/DacTypeHelpers.cs index f46bb3619..138bf9848 100644 --- a/src/Microsoft.Diagnostics.Runtime/DacImplementation/DacTypeHelpers.cs +++ b/src/Microsoft.Diagnostics.Runtime/DacImplementation/DacTypeHelpers.cs @@ -233,7 +233,7 @@ public ulong GetStaticFieldAddress(in AppDomainInfo appDomain, in ClrModuleInfo { if (_sos14 is not null) { - (ulong nonGcBase, ulong gcBase) = _sos14.GetStaticBaseAddress(module.Address); + (ulong nonGcBase, ulong gcBase) = _sos14.GetStaticBaseAddress(type.MethodTable); if (field.ElementType.IsPrimitive()) return nonGcBase + (uint)field.Offset; @@ -275,7 +275,7 @@ public ulong GetThreadStaticFieldAddress(ulong threadAddress, in ClrModuleInfo m if (_sos14 is not null) { - (ulong nonGcBase, ulong gcBase) = _sos14.GetThreadStaticBaseAddress(module.Address, threadAddress); + (ulong nonGcBase, ulong gcBase) = _sos14.GetThreadStaticBaseAddress(type.MethodTable, threadAddress); if (field.ElementType.IsPrimitive()) return nonGcBase + (uint)field.Offset; diff --git a/src/Microsoft.Diagnostics.Runtime/DacInterface/SosDac14.cs b/src/Microsoft.Diagnostics.Runtime/DacInterface/SosDac14.cs index fcc935ae5..fc00ab28a 100644 --- a/src/Microsoft.Diagnostics.Runtime/DacInterface/SosDac14.cs +++ b/src/Microsoft.Diagnostics.Runtime/DacInterface/SosDac14.cs @@ -26,15 +26,15 @@ public SosDac14(DacLibrary library, IntPtr ptr) private ref readonly ISOSDac14VTable VTable => ref Unsafe.AsRef(_vtable); - public (ulong NonGCStaticsBase, ulong GCStaticsBase) GetStaticBaseAddress(ClrDataAddress module) + public (ulong NonGCStaticsBase, ulong GCStaticsBase) GetStaticBaseAddress(ClrDataAddress methodTable) { - HResult hr = VTable.GetStaticBaseAddress(Self, module, out ClrDataAddress nonGCStaticsBase, out ClrDataAddress gcStaticsBase); + HResult hr = VTable.GetStaticBaseAddress(Self, methodTable, out ClrDataAddress nonGCStaticsBase, out ClrDataAddress gcStaticsBase); return hr ? (nonGCStaticsBase, gcStaticsBase) : (0, 0); } - public (ulong NonGCThreadStaticsBase, ulong GCThreadStaticsBase) GetThreadStaticBaseAddress(ClrDataAddress module, ClrDataAddress thread) + public (ulong NonGCThreadStaticsBase, ulong GCThreadStaticsBase) GetThreadStaticBaseAddress(ClrDataAddress methodTable, ClrDataAddress thread) { - HResult hr = VTable.GetThreadStaticBaseAddress(Self, module, thread, out ClrDataAddress nonGCThreadStaticsBase, out ClrDataAddress gcThreadStaticsBase); + HResult hr = VTable.GetThreadStaticBaseAddress(Self, methodTable, thread, out ClrDataAddress nonGCThreadStaticsBase, out ClrDataAddress gcThreadStaticsBase); return hr ? (nonGCThreadStaticsBase, gcThreadStaticsBase) : (0, 0); } diff --git a/src/Microsoft.Diagnostics.Runtime/Extensions/ClrElementTypeExtensions.cs b/src/Microsoft.Diagnostics.Runtime/Extensions/ClrElementTypeExtensions.cs index 79d0eb3ad..785d90001 100644 --- a/src/Microsoft.Diagnostics.Runtime/Extensions/ClrElementTypeExtensions.cs +++ b/src/Microsoft.Diagnostics.Runtime/Extensions/ClrElementTypeExtensions.cs @@ -8,7 +8,7 @@ internal static class ClrElementTypeExtensions public static bool IsPrimitive(this ClrElementType cet) { return cet is >= ClrElementType.Boolean and <= ClrElementType.Double - or ClrElementType.NativeInt or ClrElementType.NativeUInt; + or ClrElementType.NativeInt or ClrElementType.NativeUInt or ClrElementType.Pointer; } public static bool IsValueType(this ClrElementType cet)