Adding GetJitHelperFunctionName cDAC API#126281
Conversation
|
Tagging subscribers to this area: @steveisok, @tommcdon, @dotnet/dotnet-diag |
There was a problem hiding this comment.
Pull request overview
Adds a new cDAC contract (AuxiliarySymbols) to resolve names for dynamically-located JIT helper functions (notably write barriers) and wires it into the legacy SOS DAC GetJitHelperFunctionName API.
Changes:
- CoreCLR: export a global table/count of “interesting” JIT helper addresses + names and register write-barrier helpers into it.
- DataContractReader: introduce the
IAuxiliarySymbolscontract +JitHelperInfodata type and register the factory in the contract registry. - Tests/docs: add unit tests for the new contract and a design doc for the contract.
Reviewed changes
Copilot reviewed 19 out of 19 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| src/native/managed/cdac/tests/AuxiliarySymbolsTests.cs | New unit tests covering basic address→name resolution for the contract. |
| src/native/managed/cdac/Microsoft.Diagnostics.DataContractReader/CachingContractRegistry.cs | Registers AuxiliarySymbolsFactory so the contract can be resolved from targets. |
| src/native/managed/cdac/Microsoft.Diagnostics.DataContractReader.Legacy/SOSDacImpl.cs | Routes GetJitHelperFunctionName through the new contract and writes UTF-8 to the output buffer. |
| src/native/managed/cdac/Microsoft.Diagnostics.DataContractReader.Legacy/OutputBufferHelpers.cs | Adds a helper to copy UTF-8 strings into SOS DAC output buffers. |
| src/native/managed/cdac/Microsoft.Diagnostics.DataContractReader.Legacy/ISOSDacInterface.cs | Updates the managed signature for GetJitHelperFunctionName. |
| src/native/managed/cdac/Microsoft.Diagnostics.DataContractReader.Contracts/Data/JitHelperInfo.cs | New data reader for JitHelperInfo entries in the exported helper table. |
| src/native/managed/cdac/Microsoft.Diagnostics.DataContractReader.Contracts/Contracts/AuxiliarySymbols_1.cs | Contract implementation that scans the exported helper table for a matching code pointer. |
| src/native/managed/cdac/Microsoft.Diagnostics.DataContractReader.Contracts/Contracts/AuxiliarySymbolsFactory.cs | Factory that instantiates the v1 contract implementation. |
| src/native/managed/cdac/Microsoft.Diagnostics.DataContractReader.Contracts/Constants.cs | Adds global names for the helper table pointer and count. |
| src/native/managed/cdac/Microsoft.Diagnostics.DataContractReader.Abstractions/DataType.cs | Adds DataType.JitHelperInfo. |
| src/native/managed/cdac/Microsoft.Diagnostics.DataContractReader.Abstractions/Contracts/IAuxiliarySymbols.cs | New public contract interface and default “throws” implementation struct. |
| src/native/managed/cdac/Microsoft.Diagnostics.DataContractReader.Abstractions/ContractRegistry.cs | Exposes AuxiliarySymbols from the registry. |
| src/coreclr/vm/threads.cpp | Records dynamically-copied write-barrier addresses and their names into the new “interesting helpers” table. |
| src/coreclr/vm/jitinterface.h | Declares the new helper table/count and SetInterestingJitHelperFunction. |
| src/coreclr/vm/jitinterface.cpp | Provides DAC-accessible storage for the helper table/count under DACCESS_COMPILE. |
| src/coreclr/vm/jithelpers.cpp | Defines and populates the helper table/count and implements SetInterestingJitHelperFunction. |
| src/coreclr/vm/datadescriptor/datadescriptor.inc | Adds the JitHelperInfo type + globals and declares the AuxiliarySymbols contract. |
| src/coreclr/inc/dacvars.h | Adds DAC vars for the exported helper table/count. |
| docs/design/datacontracts/AuxiliarySymbols.md | New design doc describing the contract, descriptors, globals, and algorithm. |
src/native/managed/cdac/Microsoft.Diagnostics.DataContractReader.Legacy/OutputBufferHelpers.cs
Outdated
Show resolved
Hide resolved
src/native/managed/cdac/Microsoft.Diagnostics.DataContractReader.Legacy/SOSDacImpl.cs
Outdated
Show resolved
Hide resolved
src/native/managed/cdac/Microsoft.Diagnostics.DataContractReader.Legacy/SOSDacImpl.cs
Outdated
Show resolved
Hide resolved
src/native/managed/cdac/Microsoft.Diagnostics.DataContractReader.Legacy/SOSDacImpl.cs
Outdated
Show resolved
Hide resolved
src/native/managed/cdac/Microsoft.Diagnostics.DataContractReader.Legacy/OutputBufferHelpers.cs
Outdated
Show resolved
Hide resolved
|
cDAC code looks good to me, do we have any testing that the helper names work end to end? |
There are unit tests, and I have tested locally in windbg. |
.../managed/cdac/Microsoft.Diagnostics.DataContractReader.Contracts/Data/AuxiliarySymbolInfo.cs
Show resolved
Hide resolved
src/native/managed/cdac/Microsoft.Diagnostics.DataContractReader.Legacy/OutputBufferHelpers.cs
Outdated
Show resolved
Hide resolved
src/native/managed/cdac/Microsoft.Diagnostics.DataContractReader.Legacy/SOSDacImpl.cs
Show resolved
Hide resolved
src/native/managed/cdac/Microsoft.Diagnostics.DataContractReader.Legacy/SOSDacImpl.cs
Show resolved
Hide resolved
noahfalk
left a comment
There was a problem hiding this comment.
This looks good to me assuming we complete the brittle-DAC side you were already following up on.
Uh oh!
There was an error while loading. Please reload this page.