Remove getcontext and setcontext usage (#9759)
authorJan Vorlicek <janvorli@microsoft.com>
Fri, 24 Feb 2017 20:29:15 +0000 (21:29 +0100)
committerGitHub <noreply@github.com>
Fri, 24 Feb 2017 20:29:15 +0000 (21:29 +0100)
commitd97861ce3fecc41b35d4c2e61f60ab7e54eedee8
treeecc06a1471b7bde74d1f328d09a3dc35b4fb5a2c
parent12f575c6043e0316429df7c331121ddaefe30097
Remove getcontext and setcontext usage (#9759)

It turns out that the getcontext and setcontext that I have used in my stack
oveflow reporting change are not present e.g. on Alpine Linux or on Android.
So I am replacing their usage with RtlCaptureContext and RtlRestoreContext
instead.

I have also found that the addition of the .cfi_adjust_cfa_offset to the
PROLOG_SAVE_REG_PAIR has broken unwinding of all helpers that use
PROLOG_WITH_TRANSITION_BLOCK, because the PROLOG_STACK_ALLOC macro
updates the CFA offset. So I am fixing that by removing the CFA offset
updating from the PROLOG_STACK_ALLOC and adding explicit one to the
ARM64 CallSignalHandlerWrapper.
src/pal/inc/unixasmmacrosarm64.inc
src/pal/src/arch/amd64/signalhandlerhelper.cpp
src/pal/src/arch/arm/signalhandlerhelper.cpp
src/pal/src/arch/arm64/callsignalhandlerwrapper.S
src/pal/src/arch/arm64/signalhandlerhelper.cpp
src/pal/src/arch/i386/signalhandlerhelper.cpp
src/pal/src/exception/signal.cpp
src/pal/src/include/pal/context.h