Uh oh!
There was an error while loading. Please reload this page.
[cDAC] implement GetRuntimeNameByAddress - #127134
Conversation
Tagging subscribers to this area: @steveisok, @tommcdon, @dotnet/dotnet-diag |
There was a problem hiding this comment.
Pull request overview
This PR adds cDAC support needed to implement IXCLRDataProcess::GetRuntimeNameByAddress by enabling stub-kind classification in the ExecutionManager contract, exposing additional RangeSection/range-list metadata, and wiring up the corresponding test and native data-descriptor updates.
Changes:
- Implement
GetRuntimeNameByAddressin the managed legacy SOS DAC implementation using cDAC contracts (ExecutionManager, PrecodeStubs, AuxiliarySymbols). - Add stub classification (
StubKind,GetStubKind) and the data plumbing needed for stub range lists (RangeSection.RangeList,CodeRangeMapRangeList). - Extend tests/mocks and native CDAC descriptors/globals to support the new data contract fields and globals.
Reviewed changes
Copilot reviewed 22 out of 22 changed files in this pull request and generated 10 comments.
Show a summary per file
| File | Description |
|---|---|
| src/native/managed/cdac/tests/MockDescriptors/MockDescriptors.ExecutionManager.cs | Extends mock RangeSection with RangeList and adds mock CodeRangeMapRangeList layout + builder helpers. |
| src/native/managed/cdac/tests/ExecutionManager/ExecutionManagerTests.cs | Adds tests for stub-kind classification and registers the new mock datatype. |
| src/native/managed/cdac/Microsoft.Diagnostics.DataContractReader.Legacy/SOSDacImpl.IXCLRDataProcess.cs | Implements GetRuntimeNameByAddress using cDAC contracts and formats CLRStub names. |
| src/native/managed/cdac/Microsoft.Diagnostics.DataContractReader.Contracts/Data/RangeSection.cs | Adds RangeList pointer field to the managed RangeSection data model. |
| src/native/managed/cdac/Microsoft.Diagnostics.DataContractReader.Contracts/Data/CodeRangeMapRangeList.cs | Introduces managed data model for CodeRangeMapRangeList. |
| src/native/managed/cdac/Microsoft.Diagnostics.DataContractReader.Contracts/Contracts/PrecodeStubs_Common.cs | Adds GetCandidateEntryPoints enumeration support for precode name resolution. |
| src/native/managed/cdac/Microsoft.Diagnostics.DataContractReader.Contracts/Contracts/ExecutionManager/ExecutionManager_1.cs | Exposes GetStubKind in v1 contract wrapper. |
| src/native/managed/cdac/Microsoft.Diagnostics.DataContractReader.Contracts/Contracts/ExecutionManager/ExecutionManager_2.cs | Exposes GetStubKind in v2 contract wrapper. |
| src/native/managed/cdac/Microsoft.Diagnostics.DataContractReader.Contracts/Contracts/ExecutionManager/ExecutionManagerCore.cs | Implements GetStubKind logic (globals + range-section lookup) and reads new optional globals. |
| src/native/managed/cdac/Microsoft.Diagnostics.DataContractReader.Contracts/Contracts/ExecutionManager/ExecutionManagerCore.ReadyToRunJitManager.cs | Adds stub-kind classification for R2R thunk regions. |
| src/native/managed/cdac/Microsoft.Diagnostics.DataContractReader.Contracts/Contracts/ExecutionManager/ExecutionManagerCore.EEJitManager.cs | Adds stub-kind classification for range-list stubs and code-header stub code blocks. |
| src/native/managed/cdac/Microsoft.Diagnostics.DataContractReader.Contracts/Constants.cs | Adds new global names for well-known stubs/helpers. |
| src/native/managed/cdac/Microsoft.Diagnostics.DataContractReader.Abstractions/DataType.cs | Adds CodeRangeMapRangeList to the DataType enum. |
| src/native/managed/cdac/Microsoft.Diagnostics.DataContractReader.Abstractions/Contracts/IPrecodeStubs.cs | Adds GetCandidateEntryPoints API to support precode resolution. |
| src/native/managed/cdac/Microsoft.Diagnostics.DataContractReader.Abstractions/Contracts/IExecutionManager.cs | Adds StubKind enum and GetStubKind API. |
| src/coreclr/vm/loaderallocator.hpp | Exposes CodeRangeMapRangeList::_rangeListType via cdac_data<>. |
| src/coreclr/vm/datadescriptor/datadescriptor.inc | Adds RangeSection.RangeList, introduces CodeRangeMapRangeList type descriptor, and exports new stub globals. |
| src/coreclr/vm/codeman.h | Adds cdac_data<RangeSection>::RangeList offset. |
| src/coreclr/inc/gfunc_list.h | Adds DACGFN entries for new helper globals (platform-conditional). |
| src/coreclr/debug/daccess/daccess.cpp | Adjusts CLRStub address formatting to fixed-width hex. |
| docs/design/datacontracts/PrecodeStubs.md | Documents new GetCandidateEntryPoints API and its intended behavior. |
| docs/design/datacontracts/ExecutionManager.md | Documents GetStubKind, new RangeList/CodeRangeMapRangeList descriptors, and new globals. |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
…rTests.cs Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Co-authored-by: Jan Kotas <jkotas@microsoft.com>
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Copilot's findings
Comments suppressed due to low confidence (1)
src/coreclr/vm/codeman.h:136
- GetStubCodeBlockKindString currently returns "MethodCallThunk" for STUB_CODE_BLOCK_DYNAMICHELPER and STUB_CODE_BLOCK_FIXUPPRECODE, and it doesn't handle STUB_CODE_BLOCK_STUBPRECODE at all (falls back to "Unknown"). Since ReportStubBlock/perfmap uses this string, this will mislabel these stub kinds. Please add explicit cases for DynamicHelper/StubPrecode/FixupPrecode with appropriate names (consistent with other stub kind names like "JumpStub", "CallCountingStub", etc.).
inline const char *GetStubCodeBlockKindString(StubCodeBlockKind kind)
{
switch (kind)
{
case STUB_CODE_BLOCK_JUMPSTUB:
return "JumpStub";
case STUB_CODE_BLOCK_METHOD_CALL_THUNK:
return "MethodCallThunk";
#ifdef FEATURE_TIERED_COMPILATION
case STUB_CODE_BLOCK_CALLCOUNTING:
return "CallCountingStub";
#endif
case STUB_CODE_BLOCK_DYNAMICHELPER:
return "MethodCallThunk";
case STUB_CODE_BLOCK_FIXUPPRECODE:
return "MethodCallThunk";
#ifdef FEATURE_VIRTUAL_STUB_DISPATCH
- Files reviewed: 26/26 changed files
- Comments generated: 4
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
rcj1
commented
May 12, 2026
/ba-g timeouts :( |
This method will annotate stubs with the stub type name: for example "CallCountingStub" "VSD_DispatchStub", as well as providing auxiliary symbol names. It will also attempt to resolve Precode stubs.