Skip to content
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

[cdac] Pass a delegate into Target #105043

Merged
merged 3 commits into from
Jul 18, 2024
Merged

Conversation

jkoritzinsky
Copy link
Member

Today, the Target type in cdacreader takes an unmanaged function pointer and a context object to enable reading from target memory. This works well for the current implementation, where cdacreader is an implementation detail of the C++ DAC. However, this is more difficult for scenarios where the "reader" is also in managed code, as whatever the "context" object represents must be converted into an unmanaged function pointer. For the StressLogAnalyzer (#104999), it was relatively easy to represent the context object as a pointer. However, this is more difficult in scenarios like SOS's managed component, where the functionality to access memory is provided by a service object that's injected by a DI/IOC container.

To simplify managed-only usage scenarios, take a delegate instead of taking an unmanaged function pointer when constructing a Target object.

Copy link
Contributor

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

@jkoritzinsky
Copy link
Member Author

/ba-g Collections test failure unrelated

@jkoritzinsky jkoritzinsky merged commit d79cd32 into dotnet:main Jul 18, 2024
137 of 148 checks passed
@jkoritzinsky jkoritzinsky deleted the target-delegate branch July 18, 2024 17:01
@github-actions github-actions bot locked and limited conversation to collaborators Aug 18, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants