Port from tfs: onload exception debugger crash fix (dotnet/coreclr#4868)
authorsbomer <sbomer@gmail.com>
Wed, 18 May 2016 23:40:12 +0000 (16:40 -0700)
committerJan Kotas <jkotas@microsoft.com>
Wed, 18 May 2016 23:40:12 +0000 (16:40 -0700)
commit58b5bdadc8afbec36faa84f45889f2319f55716c
tree03ff5ad6bc6bc48911fe2015b66e5915d8ad1a17
parent1445e893613993ee32753e909c5b527420476dab
Port from tfs: onload exception debugger crash fix (dotnet/coreclr#4868)

The ExceptionHijackPersonalityRoutine was retrieving a context from a
particular stack frame, but the calling conventions for the function
executing in that frame allow it to overwrite the context. This was
causing the debugger to crash for exceptions thrown from the onload
method in winforms on x64.

The fix is to instead retrieve the context from the previous stack
frame, whose layout is set up explicitly in ExceptionHijack.

Commit migrated from https://github.com/dotnet/coreclr/commit/f1d6f7abbc5dd716cea4dc75b3da8043b9759ded
src/coreclr/src/debug/ee/amd64/dbghelpers.S
src/coreclr/src/debug/ee/amd64/dbghelpers.asm
src/coreclr/src/debug/ee/debugger.cpp