summaryrefslogtreecommitdiff
path: root/src/pal
diff options
context:
space:
mode:
authorJan Kotas <jkotas@microsoft.com>2018-08-28 15:04:04 -0700
committerGitHub <noreply@github.com>2018-08-28 15:04:04 -0700
commit5e83757c500f9c26cac8da254e0fe9e3a7580390 (patch)
tree0dcb90e0290dea975a0dd05895a4483f825fd29a /src/pal
parent1f5c48d10e97fb94aaf66efbfa1e989752a4ee02 (diff)
downloadcoreclr-5e83757c500f9c26cac8da254e0fe9e3a7580390.tar.gz
coreclr-5e83757c500f9c26cac8da254e0fe9e3a7580390.tar.bz2
coreclr-5e83757c500f9c26cac8da254e0fe9e3a7580390.zip
Break into debugger on assertion failures (#19702)
* Break into debugger on assertion failures Assertion failures terminated the process by default that made them hard to debug. Changed them to break into debugger or trigger fail fast when the debugger is not attached. This should make the day-to-day CoreCLR developer experience better and it is simular to what we had on .NET Framework in the past. * Fix Unix build break Add RaiseFailFastException to Unix PAL
Diffstat (limited to 'src/pal')
-rw-r--r--src/pal/inc/pal.h9
-rw-r--r--src/pal/src/thread/process.cpp23
2 files changed, 27 insertions, 5 deletions
diff --git a/src/pal/inc/pal.h b/src/pal/inc/pal.h
index 9676b437b0..e7ec886e87 100644
--- a/src/pal/inc/pal.h
+++ b/src/pal/inc/pal.h
@@ -3187,14 +3187,13 @@ RaiseException(
IN DWORD nNumberOfArguments,
IN CONST ULONG_PTR *lpArguments);
-#ifdef FEATURE_PAL_SXS
PALIMPORT
-PAL_NORETURN
VOID
PALAPI
-PAL_RaiseException(
- IN PEXCEPTION_POINTERS ExceptionPointers);
-#endif // FEATURE_PAL_SXS
+RaiseFailFastException(
+ IN PEXCEPTION_RECORD pExceptionRecord,
+ IN PCONTEXT pContextRecord,
+ IN DWORD dwFlags);
PALIMPORT
DWORD
diff --git a/src/pal/src/thread/process.cpp b/src/pal/src/thread/process.cpp
index 5794def818..2dfedc09d7 100644
--- a/src/pal/src/thread/process.cpp
+++ b/src/pal/src/thread/process.cpp
@@ -1316,6 +1316,29 @@ TerminateProcess(
/*++
Function:
+ RaiseFailFastException
+
+See MSDN doc.
+--*/
+VOID
+PALAPI
+RaiseFailFastException(
+ IN PEXCEPTION_RECORD pExceptionRecord,
+ IN PCONTEXT pContextRecord,
+ IN DWORD dwFlags)
+{
+ PERF_ENTRY(RaiseFailFastException);
+ ENTRY("RaiseFailFastException");
+
+ TerminateCurrentProcessNoExit(TRUE);
+ PROCAbort();
+
+ LOGEXIT("RaiseFailFastException");
+ PERF_EXIT(RaiseFailFastException);
+}
+
+/*++
+Function:
PROCEndProcess
Called from TerminateProcess and ExitProcess. This does the work of