Skip to content

Comments

Add GetStackLimits cDAC API#124682

Open
barosiak wants to merge 3 commits intodotnet:mainfrom
barosiak:barosiak/GetStackLimits
Open

Add GetStackLimits cDAC API#124682
barosiak wants to merge 3 commits intodotnet:mainfrom
barosiak:barosiak/GetStackLimits

Conversation

@barosiak
Copy link
Member

@barosiak barosiak commented Feb 21, 2026

Add GetStackLimits cDAC API

Fixes #124696

@dotnet-policy-service
Copy link
Contributor

Tagging subscribers to this area: @steveisok, @tommcdon, @dotnet/dotnet-diag
See info in area-owners.md if you want to be subscribed.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds a new GetStackLimits cDAC API that exposes thread stack boundary information through the contract data access layer. The implementation mirrors the existing legacy DAC API and provides access to cached stack base, stack limit, and frame pointer address for debugging purposes.

Changes:

  • Adds CachedStackBase and CachedStackLimit fields to the Thread data contract across all layers
  • Implements IThread.GetStackLimitData() contract method returning stack boundary information
  • Migrates ISOSDacInterface.GetStackLimits() from legacy-only to cDAC implementation with debug cross-validation

Reviewed changes

Copilot reviewed 9 out of 9 changed files in this pull request and generated no comments.

Show a summary per file
File Description
src/coreclr/vm/threads.h Added CachedStackBase and CachedStackLimit field offsets to cdac_data; removed trailing whitespace
src/coreclr/vm/datadescriptor/datadescriptor.inc Registered CachedStackBase and CachedStackLimit fields in the data descriptor
src/native/managed/cdac/Microsoft.Diagnostics.DataContractReader.Contracts/Data/Thread.cs Added CachedStackBase and CachedStackLimit properties to Thread data structure
src/native/managed/cdac/Microsoft.Diagnostics.DataContractReader.Abstractions/Contracts/IThread.cs Added StackLimitData record struct and GetStackLimitData contract method
src/native/managed/cdac/Microsoft.Diagnostics.DataContractReader.Contracts/Contracts/Thread_1.cs Implemented GetStackLimitData to return stack boundaries and frame address
src/native/managed/cdac/Microsoft.Diagnostics.DataContractReader.Legacy/SOSDacImpl.cs Migrated GetStackLimits from legacy pass-through to full cDAC implementation with debug assertions
src/native/managed/cdac/tests/ThreadTests.cs Added test coverage for GetStackLimitData API
src/native/managed/cdac/tests/MockDescriptors/MockDescriptors.cs Added CachedStackBase and CachedStackLimit to mock Thread type fields
src/native/managed/cdac/tests/MockDescriptors/MockDescriptors.Thread.cs Added SetStackLimits helper method for test setup

@rcj1
Copy link
Contributor

rcj1 commented Feb 21, 2026

Please update the markdown file docs/design/datacontracts/Thread.md with your new API and the new data descriptors used.

@barosiak barosiak marked this pull request as ready for review February 23, 2026 20:26
Copilot AI review requested due to automatic review settings February 23, 2026 20:26
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 10 out of 10 changed files in this pull request and generated 5 comments.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[cDAC] Implement ISOSDacInterface::GetStackLimits

3 participants