Improve handling of dynamic types in BulkType events #116629
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Dynamically allocated types (e.g. result of
MakeGenericType
) don't have debug information associated with them so we can't really reconstruct their names from PDB. However, we know the canonical form of the type and that one does have debug info. Emit RVA of the canonical form instead a non-sensical number.Consumers can still distinguish this is a different thing using the
TypeID
field (that is still the MethodTable pointer). The canonical form is only used forTypeNameID
, which is RVA in native AOT case and definition token in the JIT case. The consumer can quickly see thatModuleID +
TypeNameID != TypeID`.We could generate enough information to fully reconstruct the type name because the event can actually carry composition information, but that support was deleted in #94673 on native AOT side and it's currently not consumed by any tools I know of. It can be done later; Project N went to retirement with not even having the canonical forms in traces.
Cc @dotnet/ilc-contrib