[release/6.0-rc1] [debugger] Avoid calling debugger_agent_single_step_from_context when thread is not attached yet #58480
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Backport of #58467 to release/6.0-rc1
/cc @lambdageek @thaystg
The WebView calls back into the runtime on a native thread that the runtime has not seen before. The callback goes through a wrapper method. The wrapper method is responsible for registering the thread with the runtime. We were incorrectly inserting debugger sequence points in the wrapper method. As a result, if the debugger begins a suspend (which turns on single stepping - which relies on sequence points), the unregistered thread would call back to the debugger which would crash because we have no info about the thread.
Customer Impact
Android apps that embed a WebView are running in a debugger and are using the Mono interpreter (default for .NET 6 Debug configurations), may crash at startup.
Testing
Manual testing.
Risk
Low. We already support not adding debugger sequence points in some wrapper methods. This PR adds prevents sequence points from being added to one additional type of wrapper method.