-
Notifications
You must be signed in to change notification settings - Fork 5.3k
Adding GetThreadStaticBaseAddress cDAC API #118411
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
Tagging subscribers to this area: @steveisok, @dotnet/dotnet-diag |
There was a problem hiding this 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 implements the GetThreadStaticBaseAddress cDAC (Contract-based Data Access) API to enable access to thread-local static fields in the .NET runtime. The implementation provides a new diagnostic interface for retrieving base addresses of both GC and non-GC thread static variables.
Key changes:
- Implements GetThreadStaticBaseAddress method in SOSDacImpl to replace legacy fallback with full cDAC implementation
- Adds comprehensive thread-local storage (TLS) data structures and contracts for accessing thread static fields
- Integrates new TLS functionality into RuntimeTypeSystem contract for retrieving thread static base pointers
Reviewed Changes
Copilot reviewed 18 out of 18 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| SOSDacImpl.cs | Replaces legacy implementation with full cDAC implementation of GetThreadStaticBaseAddress |
| ThreadStaticsInfo.cs | New data structure for thread static information containing GC and non-GC TLS indices |
| ThreadLocalData.cs | New data structure representing thread-local data with collectible/non-collectible arrays |
| Thread.cs | Adds ThreadLocalDataPtr field to Thread data structure |
| TLSIndex.cs | New data structure for TLS index with allocation status and type information |
| InflightTLSData.cs | New data structure for in-flight TLS data during class constructor execution |
| Thread_1.cs | Implements GetThreadLocalStaticBase method with TLS index type handling |
| RuntimeTypeSystem_1.cs | Adds methods to get GC/non-GC thread static base pointers |
| Constants.cs | Adds new global constants for TLS array operations |
| DataType.cs | Adds new data types for thread-local storage structures |
| IThread.cs | Adds GetThreadLocalStaticBase method to thread contract interface |
| IRuntimeTypeSystem.cs | Adds GC/non-GC thread static base pointer methods to contract |
| threadstatics.h | Moves InFlightTLSData structure definition to header for DAC access |
| threadstatics.cpp | Updates InFlightTLSData implementation to use header definition |
| threads.h | Adds ThreadLocalDataPtr to thread data structure for cDAC |
| datadescriptor.inc | Adds cDAC type descriptors for all new TLS-related structures |
| Thread.md | Documents new thread contract API and data structures |
| RuntimeTypeSystem.md | Documents new runtime type system methods for thread statics |
...ged/cdac/Microsoft.Diagnostics.DataContractReader.Contracts/Contracts/RuntimeTypeSystem_1.cs
Outdated
Show resolved
Hide resolved
Co-authored-by: Copilot <[email protected]>
…runtime into GetThreadStaticBaseAddress
src/native/managed/cdac/mscordaccore_universal/Legacy/SOSDacImpl.cs
Outdated
Show resolved
Hide resolved
...ged/cdac/Microsoft.Diagnostics.DataContractReader.Contracts/Contracts/RuntimeTypeSystem_1.cs
Outdated
Show resolved
Hide resolved
...native/managed/cdac/Microsoft.Diagnostics.DataContractReader.Contracts/Contracts/Thread_1.cs
Outdated
Show resolved
Hide resolved
max-charlamb
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks good except for a couple small comments
No description provided.