Fix VS debugger compensation for the new EH #98847
Merged
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.
In a recent fix, I've fixed a problem that VS debugger has with the new exception handling reporting correct address for a hardware exception on a stack trace. However, that has broken the
JIT/opt/Vectorization/UnrollEqualsStartsWith test when it is run with tiered compilation disabled. In that test, the faulting instruction is the first one in a method and the compensation for the old EH issue has moved the address to the previous method. And then a call to PreserveStackTrace that the new EH ends up calling due to the way it propagates exceptions over internal native boundaries ends up asserting down in the DebugStackTrace::GetStackFramesInternal call chain, because the compensated address and the MethodDesc attached to it in the stack frame didn't match.
This change moves the compensation to the
DebugStackTrace::GetStackFramesFromException and only for the DAC code. That way only the debugger gets the compensated value.