Open
Description
Executing the following code with a debuggee that runs with .NET 9 doesn't print anything:
using DataTarget target = DataTarget.AttachToProcess(pid, suspend: false);
ClrInfo clrInfo = target.ClrVersions.Single();
ClrRuntime runtime = clrInfo.CreateRuntime();
foreach (var module in runtime.EnumerateModules()) {
foreach (var entry in module.EnumerateTypeDefToMethodTableMap()) {
ClrType? type = runtime.GetTypeByMethodTable(entry.MethodTable);
foreach (ClrStaticField? m in type?.StaticFields) {
if (m.GetAddress(runtime.AppDomains.Single()) != 0) {
Console.WriteLine($"{type} {m} {m.IsObjectReference} {m.IsInitialized(runtime.AppDomains.Single())} {m.GetAddress(runtime.AppDomains.Single())}");
}
}
}
}
When I execute the same code with a debuggee that runs with .NET 8 or .NET 7 it prints many fields.
I tried it with a simple .NET project that I wrote, and also with different pwsh versions (worked for 7.4.5 and 7.3.0, but didn't work for 7.5.0)
Metadata
Metadata
Assignees
Labels
No labels