-
Notifications
You must be signed in to change notification settings - Fork 5.2k
Correctly restore floating point context on x86 interop step-in scenarios #117632
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
Correctly restore floating point context on x86 interop step-in scenarios #117632
Conversation
Tagging subscribers to this area: @steveisok, @dotnet/dotnet-diag |
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.
Pull Request Overview
This PR ensures that the floating-point registers are correctly saved and restored on x86 interop step-in scenarios by including the CONTEXT_FLOATING_POINT
flag wherever the thread context is captured.
- Add
DT_CONTEXT_FLOATING_POINT
to context flags inrsthread.cpp
- Include
DT_CONTEXT_FLOATING_POINT
in temp context inprocess.cpp
- Update DAC interop context capture in
dacdbiimpl.cpp
to include floating-point flags
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
File | Description |
---|---|
src/coreclr/debug/di/rsthread.cpp | Include DT_CONTEXT_FLOATING_POINT when setting up thread contexts |
src/coreclr/debug/di/process.cpp | Add DT_CONTEXT_FLOATING_POINT to temporary context for restore |
src/coreclr/debug/daccess/dacdbiimpl.cpp | Pass CONTEXT_FLOATING_POINT (and extended registers) to DAC call |
Comments suppressed due to low confidence (2)
src/coreclr/debug/di/rsthread.cpp:3709
- [nitpick] Consider adding a brief comment explaining why CONTEXT_FLOATING_POINT is now required on x86 to clarify the rationale for future maintainers.
context.ContextFlags = DT_CONTEXT_FULL | DT_CONTEXT_FLOATING_POINT | DT_CONTEXT_EXTENDED_REGISTERS;
src/coreclr/debug/di/process.cpp:13284
- Add a unit or integration test that verifies floating-point register preservation on x86 interop step-in scenarios to guard against regressions.
tempContext.ContextFlags = DT_CONTEXT_FULL | DT_CONTEXT_FLOATING_POINT | DT_CONTEXT_EXTENDED_REGISTERS;
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.
👍
/ba-g failures are unrelated |
Fixes #117389
The
X86 CONTEXT_FULL
thread context flag does not includeCONTEXT_FLOATING_POINT
, while it is included on x64, arm32, arm64, as well as all other architectures defined insrc\coreclr\debug\inc\dbgtargetcontext.h
. Interop debugging uses a thread context save/restore mechanism, but was only savingCONTEXT_FULL
, causing the i387 float registers to become corrupted on x86. This change sets theCONTEXT_FLOATING_POINT
thread context flag so that we correct save and restore floating point numbers on x86.