Skip to content

Separate SOS runtime discovery from ClrMD - #6189

Merged
max-charlamb merged 8 commits into
dotnet:mainfrom
max-charlamb:runtime-description-providers
Nov 5, 2026
Merged

max-charlamb merged 8 commits into
dotnet:mainfrom
max-charlamb:runtime-description-providers

Conversation

@max-charlamb

Copy link
Copy Markdown
Member

Summary

Builds on #6010 and preserves its reference-counted shared-target lifetime.

  • Introduce the ClrMD-independent IRuntimeDescriptionProvider, RuntimeDescription, and debugging-library metadata contracts.
  • Split normal and single-file recognition. Try higher-priority providers first and stop at the first successful recognizer for each module.
  • Centralize traversal in DescriptionBasedRuntimeProvider: crash/runtime hints and the Windows entry point come first, followed by remaining modules. Default enumeration stops at the first recognized runtime; --all continues through every module.
  • Convert captured descriptions into ClrInfo and register them on one shared DataTarget with automatic ClrMD discovery disabled, without repeating export probes during conversion.
  • Use IModule directly for metadata construction and share the fixed-buffer runtime-header parser with diagnostic commands through linked source, without an ExtensionCommands reference to the Implementation assembly.

The provider rename is a separate follow-up commit for easier review.

Validation

  • Targeted DebugServices unit-test project build: no warnings or errors.
  • 112 focused discovery/provider tests passed, including cross-platform metadata parity, mock symbol-request budgets, provider priority, crash/hint ordering, and shared-target lifetime.
  • Whitespace checks passed.

Follow-ups

  • The internal NativeAOT extension still needs to adopt the new description contract; private cDAC activation is not implemented here.
  • Live cross-platform symbol-server traffic verification remains deferred; these tests simulate debugger symbol loading.
  • User-specified runtime-module prioritization remains deferred.

Max Charlamb and others added 5 commits November 4, 2026 16:34
Discover runtimes through registered SOS description providers and convert
captured metadata into ClrInfo on a shared DataTarget.

Split normal and single-file recognition, add provider priority and
hint-first traversal, and share runtime header parsing with diagnostics.

Add offline cross-platform discovery, metadata parity, symbol-budget,
and shared-target lifetime coverage.

Co-authored-by: Copilot <[email protected]>
Copilot-Session: dc2f081b-c77b-449b-a16c-7e09bf1cd9e2
Make the provider name explicit about converting runtime descriptions
into IRuntime instances. Update the filename, tests, and documentation.

Co-authored-by: Copilot <[email protected]>
Copilot-Session: dc2f081b-c77b-449b-a16c-7e09bf1cd9e2
Restore the existing document so it is excluded from this PR's diff.

Co-authored-by: Copilot <[email protected]>
Copilot-Session: dc2f081b-c77b-449b-a16c-7e09bf1cd9e2
Co-authored-by: Copilot <[email protected]>

Copilot-Session: 25eb53f8-927f-498d-94f9-0c2da243e293
Run normal .NET discovery before hinted modules. Exhaust priority discovery and use first-match fallback unless --all is requested.

Co-authored-by: Copilot <[email protected]>

Copilot-Session: dc2f081b-c77b-449b-a16c-7e09bf1cd9e2
@max-charlamb
max-charlamb marked this pull request as ready for review November 5, 2026 17:41
@max-charlamb
max-charlamb requested a review from a team as a code owner November 5, 2026 17:41
Max Charlamb added 2 commits November 5, 2026 12:51
Keep runtime hints limited to direct diagnostic-header reads and the Windows entry point. Update discovery tests to verify crash-info services are not requested.

Co-authored-by: Copilot <[email protected]>

Copilot-Session: dc2f081b-c77b-449b-a16c-7e09bf1cd9e2
Exhaust normal runtime recognition before trying hinted modules, then remaining modules. Share provider-first probing and validation across passes, with stopping policy controlled by the coordinator. Preserve exhaustive discovery with --all and avoid retrying handled modules.

Co-authored-by: Copilot <[email protected]>

Copilot-Session: dc2f081b-c77b-449b-a16c-7e09bf1cd9e2
Simplify runtime-description API comments and use explicit module name/base pairs in provider tests.

Co-authored-by: Copilot <[email protected]>

Copilot-Session: dc2f081b-c77b-449b-a16c-7e09bf1cd9e2
@max-charlamb

Copy link
Copy Markdown
Member Author

/ba-g flaky x86 test

@max-charlamb
max-charlamb merged commit 93559c0 into dotnet:main Nov 5, 2026
22 of 24 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants