You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
1. Embedded GC refs in large value types passed by value
Native:MetaSig::GcScanRoots ELEMENT_TYPE_VALUETYPE case
(src/coreclr/vm/siginfo.cpp:5437-5457) -> ReportPointersFromValueTypeArg -> walks the
type's CGCDesc series and reports each embedded GC ref.
cDAC today:GcTypeKind.Other parameters are silently skipped
(src/native/managed/cdac/Microsoft.Diagnostics.DataContractReader.Contracts/Contracts/StackWalk/GC/GcScanner.cs).
Where to implement: new helper in GcScanner.cs (or sibling ValueTypeGcWalker.cs)
consuming a new IRuntimeTypeSystem.GetGCDescSeries(typeHandle) accessor. Requires GcSignatureTypeProvider / decoder consumers to surface the TypeHandle alongside GcTypeKind.Other so the walker has the type to enumerate. The ArgIterator port already
provides IsArgPassedByRef, which is the first branch native takes here.
2. String..ctorthis-slot handling
Native:src/coreclr/vm/frames.cpp:1523-1525:
if (msig.HasThis() && pFunction->GetMethodTable() == g_pStringClass && pFunction->IsCtor())
msig.ClearHasThis();
The caller does not pass this for String..ctor; the runtime allocates and overwrites it.
cDAC today: no special case; the slot is treated as a tracked ref.
Where to implement:GcScanner.PromoteCallerStack (around the existing hasThis
capture). Needs IRuntimeTypeSystem accessors for the well-known StringMethodTable
and an IsCtor predicate on MethodDesc.
3. SuppressParamTypeArg
Native:src/coreclr/vm/frames.cpp:1527-1528:
if (pFunction->RequiresInstArg() && !SuppressParamTypeArg())
msig.SetHasParamTypeArg();
Per-Frame-subclass virtual; some frame kinds suppress the inst-arg slot.
cDAC today:RequiresInstArg is honored unconditionally in GcScanner.PromoteCallerStack.
Where to implement: extend the frame-kind table in the StackWalk contract with a SuppressParamTypeArg bool per FrameKind, then in GcScanner.PromoteCallerStack: requiresInstArg = rts.RequiresInstArg(mdh) && !frameSuppressesParamTypeArg;.
Gaps vs native DAC
1. Embedded GC refs in large value types passed by value
MetaSig::GcScanRootsELEMENT_TYPE_VALUETYPE case(
src/coreclr/vm/siginfo.cpp:5437-5457) ->ReportPointersFromValueTypeArg-> walks thetype's
CGCDescseries and reports each embedded GC ref.GcTypeKind.Otherparameters are silently skipped(
src/native/managed/cdac/Microsoft.Diagnostics.DataContractReader.Contracts/Contracts/StackWalk/GC/GcScanner.cs).GcScanner.cs(or siblingValueTypeGcWalker.cs)consuming a new
IRuntimeTypeSystem.GetGCDescSeries(typeHandle)accessor. RequiresGcSignatureTypeProvider/ decoder consumers to surface theTypeHandlealongsideGcTypeKind.Otherso the walker has the type to enumerate. TheArgIteratorport alreadyprovides
IsArgPassedByRef, which is the first branch native takes here.2.
String..ctorthis-slot handlingsrc/coreclr/vm/frames.cpp:1523-1525:thisforString..ctor; the runtime allocates and overwrites it.GcScanner.PromoteCallerStack(around the existinghasThiscapture). Needs
IRuntimeTypeSystemaccessors for the well-knownStringMethodTableand an
IsCtorpredicate onMethodDesc.3.
SuppressParamTypeArgsrc/coreclr/vm/frames.cpp:1527-1528:Frame-subclass virtual; some frame kinds suppress the inst-arg slot.RequiresInstArgis honored unconditionally inGcScanner.PromoteCallerStack.StackWalkcontract with aSuppressParamTypeArgbool perFrameKind, then inGcScanner.PromoteCallerStack:requiresInstArg = rts.RequiresInstArg(mdh) && !frameSuppressesParamTypeArg;.