Implement runtime suspension for OSX
authorJan Vorlicek <janvorli@microsoft.com>
Fri, 18 Sep 2015 13:57:49 +0000 (15:57 +0200)
committerJan Vorlicek <janvorli@microsoft.com>
Wed, 23 Sep 2015 19:21:52 +0000 (21:21 +0200)
commit0f6c0c35cc3c3d9eaee04e3e46c4898730eff1ec
tree4a04c16a0ef7ad67995b44d98b2fc3140d610479
parent4486bcf73cf9f2926ee8b1e9cb8b5c80339d9627
Implement runtime suspension for OSX

This change implements runtime suspension for OSX using activation
injection, the same mechanism as Linux uses.
I have modified the activation injection mechanism by adding a new
function that CoreCLR registers with PAL and PAL calls it to check
if an instruction address is safe for injection. The injection is
performed only if this new function returns true.
The activation on OSX is performed by suspending the target thread,
checking the instruction address in the suspended thread's context
using the above mentioned function and modifying the context to
perform the injection only at injection safe place.
17 files changed:
CMakeLists.txt
src/pal/inc/pal.h
src/pal/src/CMakeLists.txt
src/pal/src/arch/i386/activationhandlerwrapper.S [new file with mode: 0644]
src/pal/src/arch/i386/asmconstants.h [new file with mode: 0644]
src/pal/src/arch/i386/context2.S
src/pal/src/arch/i386/dispatchexceptionwrapper.S
src/pal/src/debug/debug.cpp
src/pal/src/exception/machexception.cpp
src/pal/src/exception/signal.cpp
src/pal/src/include/pal/context.h
src/pal/src/include/pal/thread.hpp
src/pal/src/thread/context.cpp
src/pal/src/thread/process.cpp
src/pal/src/thread/thread.cpp
src/pal/src/thread/threadsusp.cpp
src/vm/threadsuspend.cpp