-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
Skip putting patches in certain stubs to prevent crashing on step-in on M1 with JMC disabled #106105
Skip putting patches in certain stubs to prevent crashing on step-in on M1 with JMC disabled #106105
Conversation
Tagging subscribers to this area: @mangod9 |
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.
LGTM, one comment inline.
@mikelle-rogers is everything ready to go for this PR, and if yes can we merge it? |
contributes to #68018 |
I was waiting to see if @hoyosjs has anything else he wants to say before merging. |
Generally, this looks good. My only question is what happens when you step into optimized code (e.g. step into an r2r function). What's the new expected behavior. We should go back to the issue and try to document this. |
We set breakpoints in stubs when stepping into functions. On MacOS, it is not allowed to change binaries while code is running. Thus, if we attempt to put a patch into certain stubs which are in the text section of libcoreclr, the program will crash.
To prevent this crashing, we return false and skip/slide the step-in which then turns on the JMC probe.
The stubs that we are skipping putting patches in are VarargPInvokeStub, GenericPInvokeCalliHelper, JIT_TailCallLeave, JIT_TailCallVSDLeave, ThePreStubPatchLabel, NDirectImportThunk, ExternalMethodFixupPatchLabel, MulticastDebuggerTraceHelper