Remove getcontext and setcontext usage (dotnet/coreclr#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)
commit34ab1c3982f5bb5ac56cdc875cebd4938f5834cb
tree153c0b183b78fc690a8019b72c10c37a3ab7c1a9
parentbd777cea9271aa2c4d08c3af7c243ede55f95ed9
Remove getcontext and setcontext usage (dotnet/coreclr#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.

Commit migrated from https://github.com/dotnet/coreclr/commit/d97861ce3fecc41b35d4c2e61f60ab7e54eedee8
src/coreclr/src/pal/inc/unixasmmacrosarm64.inc
src/coreclr/src/pal/src/arch/amd64/signalhandlerhelper.cpp
src/coreclr/src/pal/src/arch/arm/signalhandlerhelper.cpp
src/coreclr/src/pal/src/arch/arm64/callsignalhandlerwrapper.S
src/coreclr/src/pal/src/arch/arm64/signalhandlerhelper.cpp
src/coreclr/src/pal/src/arch/i386/signalhandlerhelper.cpp
src/coreclr/src/pal/src/exception/signal.cpp
src/coreclr/src/pal/src/include/pal/context.h