summaryrefslogtreecommitdiff
path: root/src/pal/src/CMakeLists.txt
diff options
context:
space:
mode:
authorMike McLaughlin <mikem@microsoft.com>2015-11-10 14:28:10 -0800
committerMike McLaughlin <mikem@microsoft.com>2015-11-12 15:00:10 -0800
commit9ef5ee736212e95d456cc13f3e1f7ff96db51bef (patch)
treeb139014f574836adb77f9c215eb0c8f872cdd4ac /src/pal/src/CMakeLists.txt
parentb13c844a60d553a6f78eb4b2a2c912a8bc07540f (diff)
downloadcoreclr-9ef5ee736212e95d456cc13f3e1f7ff96db51bef.tar.gz
coreclr-9ef5ee736212e95d456cc13f3e1f7ff96db51bef.tar.bz2
coreclr-9ef5ee736212e95d456cc13f3e1f7ff96db51bef.zip
Fix Thread.Start while debugging bug on OSX.
The OSX exception logic is running on a separate thread from the one that the exception happened. The CatchHardwareExceptionHolder::IsEnabled used to check for h/w exception holders assumed it was running on the thread the exception/holders happened not the exception notification thread. Moved the h/w exception holder count to the CPalThread object instead of a TLS thread variable so the OSX exception code can check it given a CPalThread instance. The main problem was that the stubmgr when creating a thread (for the start notification) put a breakpoint in ThePreStubPatch which is in the coreclr text section and because the h/w exception holder check was broken, it thought the breakpoint wasn't the debugger's and aborted the coreclr process. The other part of this fix is to put a h/w exception holder around the called to ThePreStubPatch in prestub.cpp. The stubmgr's delegate invoke subclass used the wrong registers for Linux/OSX to read the "this" and parameter registers. Added the proper ifdefs and registers (ecx -> rdi, rdx -> rsi) for the Unix platforms. On both Linux and OSX, the h/w exception holder check in the exception routing logic needed to check if the int3/trap is in DBG_DebugBreak so asserts always abort/core dump. Move DBG_DebugBreak to an assembly worker so the start/end address can be used for this check.
Diffstat (limited to 'src/pal/src/CMakeLists.txt')
-rw-r--r--src/pal/src/CMakeLists.txt3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/pal/src/CMakeLists.txt b/src/pal/src/CMakeLists.txt
index 0191a992d3..b1f11bd9e3 100644
--- a/src/pal/src/CMakeLists.txt
+++ b/src/pal/src/CMakeLists.txt
@@ -73,16 +73,19 @@ add_compile_options(-fPIC)
if(PAL_CMAKE_PLATFORM_ARCH_AMD64)
set(ARCH_SOURCES
arch/i386/context2.S
+ arch/i386/debugbreak.S
arch/i386/processor.cpp
)
elseif(PAL_CMAKE_PLATFORM_ARCH_ARM)
set(ARCH_SOURCES
arch/arm/context2.S
+ arch/arm/debugbreak.S
arch/arm/processor.cpp
)
elseif(PAL_CMAKE_PLATFORM_ARCH_ARM64)
set(ARCH_SOURCES
arch/arm64/context2.S
+ arch/arm64/debugbreak.S
arch/arm64/processor.cpp
)
endif()