Add support for async thunk methods in GetNativeCodeInfo#124354
Add support for async thunk methods in GetNativeCodeInfo#124354tommcdon merged 5 commits intodotnet:mainfrom
Conversation
|
Tagging subscribers to this area: @steveisok, @tommcdon, @dotnet/dotnet-diag |
There was a problem hiding this comment.
Pull request overview
This PR attempts to fix an issue where DacDbiInterfaceImpl::GetNativeCodeInfo incorrectly returns data for async thunk methods instead of the actual async implementation method. The runtime caches async thunks in the methoddef map (see clsload.cpp:2804-2810), causing FindLoadedMethodRefOrDef to return the thunk. This PR adds logic to detect async thunk methods and attempts to find the corresponding async implementation method by iterating through all methods in the type.
Changes:
- Added logic to detect async thunk methods using
IsAsyncThunkMethod() - Implemented a loop to iterate through all introduced methods in the method table
- Filters methods using
IsDiagnosticsHidden()to find the actual async implementation method
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
cf4515c to
60b8049
Compare
|
/ba-g changes only affect the DAC |
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.
You can also share your feedback on Copilot code review. Take the survey.
Co-authored-by: Noah Falk <noahfalk@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.
You can also share your feedback on Copilot code review. Take the survey.
|
/ba-g failures are known issues |
The runtime by default caches the async thunk when looking up runtime async methods in the methoddef map:
runtime/src/coreclr/vm/clsload.cpp
Lines 2804 to 2810 in 0c7ef81
This causes
DacDbiInterfaceImpl::GetNativeCodeInfoto incorrectly return data for the async thunk and not the actual method.