Uh oh!
There was an error while loading. Please reload this page.
Add support for async thunk methods in GetNativeCodeInfo - #124529
Add support for async thunk methods in GetNativeCodeInfo#124529max-charlamb wants to merge 3 commits into
Conversation
Tagging subscribers to this area: @agocke |
There was a problem hiding this comment.
Pull request overview
This pull request adds support for async thunk methods in GetNativeCodeInfo by enabling the debugger DAC to resolve async thunk methods to their actual implementation method descriptors. The runtime caches async thunks in the methoddef map, which causes the debugger to incorrectly return data for the thunk instead of the actual method. This PR addresses that by:
- Adding DAC support to the generic method infrastructure (
genmeth.cpp,instmethhash.cpp,generics.cpp) - Creating a new
GetAsyncOtherVariantNoCreatemethod that finds async variants without creating new ones (DAC-safe) - Using this new method in
GetNativeCodeInfoto resolve async thunk methods to their actual implementations
Changes:
- Added DAC compilation support to generic method code by moving
genmeth.cppto DAC+WKS build and adding appropriateDACCESS_COMPILEguards - Created
GetAsyncOtherVariantNoCreatemethod to look up async method variants without allocation - Modified
GetNativeCodeInfoto resolve async thunk methods to actual methods using the new lookup function
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| src/coreclr/vm/method.hpp | Adds GetAsyncOtherVariantNoCreate method that calls FindOrCreateAssociatedMethodDesc with allowCreate=FALSE |
| src/coreclr/vm/instmethhash.cpp | Makes Hash function DAC-compatible by using dac_cast, moves FindMethodDesc outside DACCESS_COMPILE guard |
| src/coreclr/vm/genmeth.cpp | Adds extensive DACCESS_COMPILE guards around creation code, adds SUPPORTS_DAC markers to contracts |
| src/coreclr/vm/generics.cpp | Moves CheckInstantiation outside DACCESS_COMPILE guard to make it available for DAC builds |
| src/coreclr/vm/CMakeLists.txt | Moves genmeth.cpp from VM_SOURCES_WKS to VM_SOURCES_DAC_AND_WKS_COMMON to enable DAC compilation |
| src/coreclr/debug/daccess/dacdbiimpl.cpp | Resolves async thunk methods to actual methods by calling GetAsyncOtherVariantNoCreate |
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: Copilot <175728472+Copilot@users.noreply.github.com>
Draft Pull Request was automatically closed for 30 days of inactivity. Please let us know if you'd like to reopen it. |
Fork of #124354 which uses the existing FindOrCreateAssociatedMethodDesc logic