diff --git a/Samples/Tests/IntegrationTests.swift b/Samples/Tests/IntegrationTests.swift index 63a89a50..7c0e5ba4 100644 --- a/Samples/Tests/IntegrationTests.swift +++ b/Samples/Tests/IntegrationTests.swift @@ -59,9 +59,7 @@ final class MachTests: IntegrationTestBase { final class CppTests: IntegrationTestBase { func testRuntimeException() throws { - try launchAndCrash(.cpp_runtimeException) { - $0.isCxaThrowEnabled = true - } + try launchAndCrash(.cpp_runtimeException) let rawReport = try readPartialCrashReport() try rawReport.validate() diff --git a/Sources/KSCrashRecording/include/KSCrashCConfiguration.h b/Sources/KSCrashRecording/include/KSCrashCConfiguration.h index 548faa20..f7a3e9f0 100644 --- a/Sources/KSCrashRecording/include/KSCrashCConfiguration.h +++ b/Sources/KSCrashRecording/include/KSCrashCConfiguration.h @@ -156,7 +156,7 @@ typedef struct { * accurate stack traces even in dynamically linked libraries and allows overriding * the original `__cxa_throw` with a custom implementation. * - * **Default**: false + * **Default**: true */ bool enableSwapCxaThrow; } KSCrashCConfiguration; @@ -174,7 +174,7 @@ static inline KSCrashCConfiguration KSCrashCConfiguration_Default(void) .addConsoleLogToReport = false, .printPreviousLogOnStartup = false, .maxReportCount = 5, - .enableSwapCxaThrow = false }; + .enableSwapCxaThrow = true }; } #ifdef __cplusplus diff --git a/Sources/KSCrashRecording/include/KSCrashConfiguration.h b/Sources/KSCrashRecording/include/KSCrashConfiguration.h index a61785dc..60a099ab 100644 --- a/Sources/KSCrashRecording/include/KSCrashConfiguration.h +++ b/Sources/KSCrashRecording/include/KSCrashConfiguration.h @@ -148,7 +148,7 @@ typedef NS_ENUM(NSUInteger, KSCDeleteBehavior) { * accurate stack traces even in dynamically linked libraries and allows overriding * the original `__cxa_throw` with a custom implementation. * - * **Default**: false + * **Default**: true */ @property(nonatomic, assign) BOOL enableSwapCxaThrow; diff --git a/Tests/KSCrashRecordingTests/KSCrashConfiguration_Tests.m b/Tests/KSCrashRecordingTests/KSCrashConfiguration_Tests.m index 37fc185d..bcbf2620 100644 --- a/Tests/KSCrashRecordingTests/KSCrashConfiguration_Tests.m +++ b/Tests/KSCrashRecordingTests/KSCrashConfiguration_Tests.m @@ -48,7 +48,7 @@ - (void)testInitializationDefaults XCTAssertFalse(config.addConsoleLogToReport); XCTAssertFalse(config.printPreviousLogOnStartup); XCTAssertEqual(config.maxReportCount, 5); - XCTAssertFalse(config.enableSwapCxaThrow); + XCTAssertTrue(config.enableSwapCxaThrow); XCTAssertEqual(config.deleteBehaviorAfterSendAll, KSCDeleteAlways); } @@ -64,7 +64,7 @@ - (void)testToCConfiguration config.addConsoleLogToReport = YES; config.printPreviousLogOnStartup = YES; config.maxReportCount = 10; - config.enableSwapCxaThrow = YES; + config.enableSwapCxaThrow = NO; KSCrashCConfiguration cConfig = [config toCConfiguration]; @@ -80,7 +80,7 @@ - (void)testToCConfiguration XCTAssertTrue(cConfig.addConsoleLogToReport); XCTAssertTrue(cConfig.printPreviousLogOnStartup); XCTAssertEqual(cConfig.maxReportCount, 10); - XCTAssertTrue(cConfig.enableSwapCxaThrow); + XCTAssertFalse(cConfig.enableSwapCxaThrow); // Free memory allocated for C string array for (int i = 0; i < cConfig.doNotIntrospectClasses.length; i++) { @@ -102,7 +102,7 @@ - (void)testCopyWithZone config.addConsoleLogToReport = YES; config.printPreviousLogOnStartup = YES; config.maxReportCount = 10; - config.enableSwapCxaThrow = YES; + config.enableSwapCxaThrow = NO; KSCrashConfiguration *copy = [config copy]; @@ -115,7 +115,7 @@ - (void)testCopyWithZone XCTAssertTrue(copy.addConsoleLogToReport); XCTAssertTrue(copy.printPreviousLogOnStartup); XCTAssertEqual(copy.maxReportCount, 10); - XCTAssertTrue(copy.enableSwapCxaThrow); + XCTAssertFalse(copy.enableSwapCxaThrow); XCTAssertEqual(copy.deleteBehaviorAfterSendAll, KSCDeleteAlways); }