Skip to content

Follow-up diagnostics work for dynamic metadata-less types in .NET 11 #120800

@jakobbotsch

Description

@jakobbotsch

With #120411 merged and with DOTNET_RuntimeAsync=1 the runtime creates new dynamic Continuation MethodTables that do not have associated metadata. This issue captures diagnostics work required to support querying these.

Quoting @noahfalk from #120411 (comment):

  • All our APIs that expose object layouts do so in terms of metadata FieldDefs which we don't have here. At minimum we'd be breaking the assumption that the layout information is complete. If we wanted to go farther we could create new layout APIs that aren't backed by metadata tokens.
    Profiler API
    Debugger API

  • In the case of debugging, there is no API that enumerates GC references in an object separate from the layout API. We'd need to create that.

  • For debugging, profiling, and GCDumps emitted by events we have algorithms that do GC heap traversal. We'll need to ensure those algorithms are correctly handling these types (this may just fall out for free from the right GCDescs)

  • APIs that expose TypeDef tokens for types will need updates not to expose a token for these Continuation sub-types. The behavior change might need changes in the 3rd party tool code to accomodate for it. (ICorDebugClass::GetToken(), ICorProfilerInfo::GetClassIdInfo())

Also quoting @jkotas:

When designing these APIs, we should generalize them where possible to cover any no metadata types internally created by the runtime. We may want to use them for storing statics and get rid of static boxes.

These APIs may be useful for InlineArray types whose metadata does not convey their representation fully.

  • Profiler API not backed by metadata tokens
  • Debugger API not backed by metadata tokens
  • Debugger API to enumerate GC references in an object
  • GC heap traversal
    • Debugger
    • Profiler
    • GC dumps
  • ICorDebugClass::GetToken, ICorProfilerInfo::GetClassIdInfo fixes

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions