Skip to content

Commit 4ca86a5

Browse files
committed
[DNM] Enable fatal error backtraces
1 parent 089b61d commit 4ca86a5

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

stdlib/public/runtime/Casting.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -385,7 +385,7 @@ SWIFT_NORETURN SWIFT_NOINLINE void
385385
swift::swift_dynamicCastFailure(const void *sourceType, const char *sourceName,
386386
const void *targetType, const char *targetName,
387387
const char *message) {
388-
swift::fatalError(/* flags = */ 0,
388+
swift::fatalError(/* flags = */ 1,
389389
"Could not cast value of type '%s' (%p) to '%s' (%p)%s%s\n",
390390
sourceName, sourceType,
391391
targetName, targetType,

stdlib/public/runtime/Errors.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -400,6 +400,7 @@ bool swift::_swift_shouldReportFatalErrorsToDebugger() {
400400
/// Does not crash by itself.
401401
void swift::swift_reportError(uint32_t flags,
402402
const char *message) {
403+
#if 0
403404
#if defined(__APPLE__) && NDEBUG
404405
flags &= ~FatalErrorFlags::ReportBacktrace;
405406
#elif SWIFT_ENABLE_BACKTRACING
@@ -408,7 +409,8 @@ void swift::swift_reportError(uint32_t flags,
408409
flags &= ~FatalErrorFlags::ReportBacktrace;
409410
}
410411
#endif
411-
412+
#endif
413+
412414
reportNow(flags, message);
413415
reportOnCrash(flags, message);
414416
}

0 commit comments

Comments
 (0)