From 1df3813e90fdd9ab0c845d21620ed323d45022d7 Mon Sep 17 00:00:00 2001 From: Noah Martin Date: Fri, 17 Oct 2025 21:43:12 -0400 Subject: [PATCH] ref: Remove v9 checks for debug image provider --- Sentry.xcodeproj/project.pbxproj | 30 ++--- .../SentryTestUtils-ObjC-BridgingHeader.h | 1 - SentryTestUtils/TestDebugImageProvider.swift | 14 +-- Sources/Resources/Sentry.modulemap | 1 - Sources/Sentry/PrivateSentrySDKOnly.m | 19 --- .../Profiling/SentryProfilerSerialization.m | 1 - Sources/Sentry/Public/Sentry.h | 1 - .../Sentry/Public/SentryDebugImageProvider.h | 93 -------------- Sources/Sentry/Public/SentryWithoutUIKit.h | 1 - Sources/Sentry/SentryANRTrackingIntegration.m | 1 - Sources/Sentry/SentryClient.m | 1 - ...r.m => SentryDebugImageProviderInternal.m} | 117 ++--------------- Sources/Sentry/SentryDependencyContainer.m | 1 - Sources/Sentry/SentryTracer.m | 1 - .../HybridPublic/PrivateSentrySDKOnly.h | 20 --- ...s.h => SentryDebugImageProviderInternal.h} | 13 +- Sources/Sentry/include/SentryPrivate.h | 1 + .../SentryDebugImageProvider.swift | 38 ++++++ .../SentryDebugImageProvider+TestInit.h | 14 --- .../SentryDebugImageProviderTests.swift | 119 +----------------- .../TestSentryCrashBinaryImageProvider.swift | 19 --- .../SentryTests/SentryTests-Bridging-Header.h | 2 - sdk_api.json | 10 -- 23 files changed, 68 insertions(+), 450 deletions(-) delete mode 100644 Sources/Sentry/Public/SentryDebugImageProvider.h rename Sources/Sentry/{SentryDebugImageProvider.m => SentryDebugImageProviderInternal.m} (50%) rename Sources/Sentry/include/{HybridPublic/SentryDebugImageProvider+HybridSDKs.h => SentryDebugImageProviderInternal.h} (85%) create mode 100644 Sources/Swift/SentryCrash/SentryDebugImageProvider.swift delete mode 100644 Tests/SentryTests/SentryCrash/SentryDebugImageProvider+TestInit.h delete mode 100644 Tests/SentryTests/SentryCrash/TestSentryCrashBinaryImageProvider.swift diff --git a/Sentry.xcodeproj/project.pbxproj b/Sentry.xcodeproj/project.pbxproj index f5d0ddd9fbb..5aa4863eef7 100644 --- a/Sentry.xcodeproj/project.pbxproj +++ b/Sentry.xcodeproj/project.pbxproj @@ -87,7 +87,7 @@ 623FD9062D3FA9C800803EDA /* NSNumberDecodableWrapperTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 623FD9052D3FA9BA00803EDA /* NSNumberDecodableWrapperTests.swift */; }; 626E2D4C2BEA0C37005596FE /* SentryEnabledFeaturesBuilderTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 626E2D4B2BEA0C37005596FE /* SentryEnabledFeaturesBuilderTests.swift */; }; 6271ADF32BA06D9B0098D2E9 /* SentryInternalSerializable.h in Headers */ = {isa = PBXBuildFile; fileRef = 6271ADF22BA06D9B0098D2E9 /* SentryInternalSerializable.h */; settings = {ATTRIBUTES = (Private, ); }; }; - 6273513F2CBD14970021D100 /* SentryDebugImageProvider+HybridSDKs.h in Headers */ = {isa = PBXBuildFile; fileRef = 6273513E2CBD14970021D100 /* SentryDebugImageProvider+HybridSDKs.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 6273513F2CBD14970021D100 /* SentryDebugImageProviderInternal.h in Headers */ = {isa = PBXBuildFile; fileRef = 6273513E2CBD14970021D100 /* SentryDebugImageProviderInternal.h */; settings = {ATTRIBUTES = (Private, ); }; }; 6276350C2D59FACC00F7CEF6 /* SentryEventDecoder.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6276350B2D59FACC00F7CEF6 /* SentryEventDecoder.swift */; }; 6276E68B2E7A779B002A4A8F /* SentryNetworkTrackerIntegrationTestServerTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6276E68A2E7A779B002A4A8F /* SentryNetworkTrackerIntegrationTestServerTests.swift */; }; 627C77892D50B6840055E966 /* SentryBreadcrumbCodable.swift in Sources */ = {isa = PBXBuildFile; fileRef = 627C77882D50B6840055E966 /* SentryBreadcrumbCodable.swift */; }; @@ -458,13 +458,11 @@ 7BA0C0482805600A003E0326 /* SentryTransportAdapter.m in Sources */ = {isa = PBXBuildFile; fileRef = 7BA0C0472805600A003E0326 /* SentryTransportAdapter.m */; }; 7BA0C04C28056556003E0326 /* SentryTransportAdapterTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7BA0C04B28056556003E0326 /* SentryTransportAdapterTests.swift */; }; 7BA235632600B61200E12865 /* SentryInternalNotificationNames.h in Headers */ = {isa = PBXBuildFile; fileRef = 7BA235622600B61200E12865 /* SentryInternalNotificationNames.h */; }; - 7BA61CAB247BA98100C130A8 /* SentryDebugImageProvider.h in Headers */ = {isa = PBXBuildFile; fileRef = 7BA61CAA247BA98100C130A8 /* SentryDebugImageProvider.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 7BA61CAD247BAA0B00C130A8 /* SentryDebugImageProvider.m in Sources */ = {isa = PBXBuildFile; fileRef = 7BA61CAC247BAA0B00C130A8 /* SentryDebugImageProvider.m */; }; + 7BA61CAD247BAA0B00C130A8 /* SentryDebugImageProviderInternal.m in Sources */ = {isa = PBXBuildFile; fileRef = 7BA61CAC247BAA0B00C130A8 /* SentryDebugImageProviderInternal.m */; }; 7BA61CAF247BBF3C00C130A8 /* SentryDebugImageProviderTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7BA61CAE247BBF3C00C130A8 /* SentryDebugImageProviderTests.swift */; }; 7BA61CB4247BC3EB00C130A8 /* SentryCrashBinaryImageProvider.h in Headers */ = {isa = PBXBuildFile; fileRef = 7BA61CB3247BC3EB00C130A8 /* SentryCrashBinaryImageProvider.h */; }; 7BA61CB9247BC57B00C130A8 /* SentryCrashDefaultBinaryImageProvider.h in Headers */ = {isa = PBXBuildFile; fileRef = 7BA61CB8247BC57B00C130A8 /* SentryCrashDefaultBinaryImageProvider.h */; }; 7BA61CBB247BC5D800C130A8 /* SentryCrashDefaultBinaryImageProvider.m in Sources */ = {isa = PBXBuildFile; fileRef = 7BA61CBA247BC5D800C130A8 /* SentryCrashDefaultBinaryImageProvider.m */; }; - 7BA61CBD247BC6B900C130A8 /* TestSentryCrashBinaryImageProvider.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7BA61CBC247BC6B900C130A8 /* TestSentryCrashBinaryImageProvider.swift */; }; 7BA61CBF247CEA8100C130A8 /* SentryFormatter.h in Headers */ = {isa = PBXBuildFile; fileRef = 7BA61CBE247CEA8100C130A8 /* SentryFormatter.h */; settings = {ATTRIBUTES = (Private, ); }; }; 7BA61CC6247CFC5F00C130A8 /* SentryCrashDefaultBinaryImageProviderTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7BA61CC5247CFC5F00C130A8 /* SentryCrashDefaultBinaryImageProviderTests.swift */; }; 7BA61CC8247D125400C130A8 /* SentryDefaultThreadInspector.h in Headers */ = {isa = PBXBuildFile; fileRef = 7BA61CC7247D125400C130A8 /* SentryDefaultThreadInspector.h */; }; @@ -1114,6 +1112,7 @@ FAAB95C02EA163590030A2DB /* SentryScopeObserver.swift in Sources */ = {isa = PBXBuildFile; fileRef = FAAB95BF2EA163590030A2DB /* SentryScopeObserver.swift */; }; FAAB95D82EA1E23F0030A2DB /* SentryExtraContextProvider.swift in Sources */ = {isa = PBXBuildFile; fileRef = FAAB95D22EA1E23A0030A2DB /* SentryExtraContextProvider.swift */; }; FAAB95DE2EA1EB470030A2DB /* SentryDeviceContextKeys.h in Headers */ = {isa = PBXBuildFile; fileRef = FAAB95DD2EA1EB470030A2DB /* SentryDeviceContextKeys.h */; }; + FAAB96132EA31FA20030A2DB /* SentryDebugImageProvider.swift in Sources */ = {isa = PBXBuildFile; fileRef = FAAB96122EA31F9E0030A2DB /* SentryDebugImageProvider.swift */; }; FAB007362E9EF8D3001C806A /* SentryUIViewControllerPerformanceTracker.swift in Sources */ = {isa = PBXBuildFile; fileRef = FAB007302E9EF8CB001C806A /* SentryUIViewControllerPerformanceTracker.swift */; }; FAB007432E9F47E8001C806A /* SessionTracker.swift in Sources */ = {isa = PBXBuildFile; fileRef = FAB007422E9F47E4001C806A /* SessionTracker.swift */; }; FAB007522E9FE2FF001C806A /* SentrySwizzleWrapper.swift in Sources */ = {isa = PBXBuildFile; fileRef = FAB0074C2E9FE2FA001C806A /* SentrySwizzleWrapper.swift */; }; @@ -1346,7 +1345,7 @@ 624729172DE5980500DFEE00 /* TestCurrentDateProviderTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TestCurrentDateProviderTests.swift; sourceTree = ""; }; 626E2D4B2BEA0C37005596FE /* SentryEnabledFeaturesBuilderTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SentryEnabledFeaturesBuilderTests.swift; sourceTree = ""; }; 6271ADF22BA06D9B0098D2E9 /* SentryInternalSerializable.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = SentryInternalSerializable.h; path = include/SentryInternalSerializable.h; sourceTree = ""; }; - 6273513E2CBD14970021D100 /* SentryDebugImageProvider+HybridSDKs.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = "SentryDebugImageProvider+HybridSDKs.h"; path = "include/HybridPublic/SentryDebugImageProvider+HybridSDKs.h"; sourceTree = ""; }; + 6273513E2CBD14970021D100 /* SentryDebugImageProviderInternal.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = SentryDebugImageProviderInternal.h; path = include/SentryDebugImageProviderInternal.h; sourceTree = ""; }; 6276350B2D59FACC00F7CEF6 /* SentryEventDecoder.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SentryEventDecoder.swift; sourceTree = ""; }; 6276E68A2E7A779B002A4A8F /* SentryNetworkTrackerIntegrationTestServerTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SentryNetworkTrackerIntegrationTestServerTests.swift; sourceTree = ""; }; 627C77882D50B6840055E966 /* SentryBreadcrumbCodable.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SentryBreadcrumbCodable.swift; sourceTree = ""; }; @@ -1646,7 +1645,6 @@ 7B3B473D25D6CEA500D01640 /* SentryNSErrorTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SentryNSErrorTests.swift; sourceTree = ""; }; 7B42C47F27E08F33009B58C2 /* SentryDependencyContainer.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = SentryDependencyContainer.h; path = include/HybridPublic/SentryDependencyContainer.h; sourceTree = ""; }; 7B42C48127E08F4B009B58C2 /* SentryDependencyContainer.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SentryDependencyContainer.m; sourceTree = ""; }; - 7B451483263ABAB7008AFFEB /* SentryDebugImageProvider+TestInit.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "SentryDebugImageProvider+TestInit.h"; sourceTree = ""; }; 7B4C817124D1BC2B0076ACE4 /* SentryFileManager+Test.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "SentryFileManager+Test.h"; sourceTree = ""; }; 7B4D308926FC616B00C94DE9 /* SentryHttpTransportTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SentryHttpTransportTests.swift; sourceTree = ""; }; 7B4E23AE2519E13800060D68 /* SentryCrashIntegration+TestInit.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "SentryCrashIntegration+TestInit.h"; sourceTree = ""; }; @@ -1747,13 +1745,11 @@ 7BA0C04B28056556003E0326 /* SentryTransportAdapterTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SentryTransportAdapterTests.swift; sourceTree = ""; }; 7BA1C51E2716DDB3005D75A4 /* Invocations.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Invocations.swift; sourceTree = ""; }; 7BA235622600B61200E12865 /* SentryInternalNotificationNames.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = SentryInternalNotificationNames.h; path = include/SentryInternalNotificationNames.h; sourceTree = ""; }; - 7BA61CAA247BA98100C130A8 /* SentryDebugImageProvider.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = SentryDebugImageProvider.h; path = Public/SentryDebugImageProvider.h; sourceTree = ""; }; - 7BA61CAC247BAA0B00C130A8 /* SentryDebugImageProvider.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SentryDebugImageProvider.m; sourceTree = ""; }; + 7BA61CAC247BAA0B00C130A8 /* SentryDebugImageProviderInternal.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SentryDebugImageProviderInternal.m; sourceTree = ""; }; 7BA61CAE247BBF3C00C130A8 /* SentryDebugImageProviderTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SentryDebugImageProviderTests.swift; sourceTree = ""; }; 7BA61CB3247BC3EB00C130A8 /* SentryCrashBinaryImageProvider.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = SentryCrashBinaryImageProvider.h; path = include/SentryCrashBinaryImageProvider.h; sourceTree = ""; }; 7BA61CB8247BC57B00C130A8 /* SentryCrashDefaultBinaryImageProvider.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = SentryCrashDefaultBinaryImageProvider.h; path = include/SentryCrashDefaultBinaryImageProvider.h; sourceTree = ""; }; 7BA61CBA247BC5D800C130A8 /* SentryCrashDefaultBinaryImageProvider.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SentryCrashDefaultBinaryImageProvider.m; sourceTree = ""; }; - 7BA61CBC247BC6B900C130A8 /* TestSentryCrashBinaryImageProvider.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TestSentryCrashBinaryImageProvider.swift; sourceTree = ""; }; 7BA61CBE247CEA8100C130A8 /* SentryFormatter.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = SentryFormatter.h; path = include/HybridPublic/SentryFormatter.h; sourceTree = ""; }; 7BA61CC5247CFC5F00C130A8 /* SentryCrashDefaultBinaryImageProviderTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SentryCrashDefaultBinaryImageProviderTests.swift; sourceTree = ""; }; 7BA61CC7247D125400C130A8 /* SentryDefaultThreadInspector.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = SentryDefaultThreadInspector.h; path = include/SentryDefaultThreadInspector.h; sourceTree = ""; }; @@ -2478,6 +2474,7 @@ FAAB95BF2EA163590030A2DB /* SentryScopeObserver.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SentryScopeObserver.swift; sourceTree = ""; }; FAAB95D22EA1E23A0030A2DB /* SentryExtraContextProvider.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SentryExtraContextProvider.swift; sourceTree = ""; }; FAAB95DD2EA1EB470030A2DB /* SentryDeviceContextKeys.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = SentryDeviceContextKeys.h; path = include/SentryDeviceContextKeys.h; sourceTree = ""; }; + FAAB96122EA31F9E0030A2DB /* SentryDebugImageProvider.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SentryDebugImageProvider.swift; sourceTree = ""; }; FAB007302E9EF8CB001C806A /* SentryUIViewControllerPerformanceTracker.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SentryUIViewControllerPerformanceTracker.swift; sourceTree = ""; }; FAB007422E9F47E4001C806A /* SessionTracker.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SessionTracker.swift; sourceTree = ""; }; FAB0074C2E9FE2FA001C806A /* SentrySwizzleWrapper.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SentrySwizzleWrapper.swift; sourceTree = ""; }; @@ -2869,9 +2866,8 @@ 7BA61CB3247BC3EB00C130A8 /* SentryCrashBinaryImageProvider.h */, 7BA61CB8247BC57B00C130A8 /* SentryCrashDefaultBinaryImageProvider.h */, 7BA61CBA247BC5D800C130A8 /* SentryCrashDefaultBinaryImageProvider.m */, - 7BA61CAA247BA98100C130A8 /* SentryDebugImageProvider.h */, - 6273513E2CBD14970021D100 /* SentryDebugImageProvider+HybridSDKs.h */, - 7BA61CAC247BAA0B00C130A8 /* SentryDebugImageProvider.m */, + 6273513E2CBD14970021D100 /* SentryDebugImageProviderInternal.h */, + 7BA61CAC247BAA0B00C130A8 /* SentryDebugImageProviderInternal.m */, 7BA61CBE247CEA8100C130A8 /* SentryFormatter.h */, 7BA61CC7247D125400C130A8 /* SentryDefaultThreadInspector.h */, 7BA61CC9247D128B00C130A8 /* SentryDefaultThreadInspector.m */, @@ -3343,8 +3339,6 @@ 63FE71F020DA66EA00CDBAE8 /* XCTestCase+SentryCrash.h */, 63FE71DE20DA66E800CDBAE8 /* XCTestCase+SentryCrash.m */, 7BA61CAE247BBF3C00C130A8 /* SentryDebugImageProviderTests.swift */, - 7B451483263ABAB7008AFFEB /* SentryDebugImageProvider+TestInit.h */, - 7BA61CBC247BC6B900C130A8 /* TestSentryCrashBinaryImageProvider.swift */, 7BA61CC5247CFC5F00C130A8 /* SentryCrashDefaultBinaryImageProviderTests.swift */, 7BA61CCE247EB59500C130A8 /* SentryCrashUUIDConversionTests.swift */, 7BA61CCB247D14E600C130A8 /* SentryDefaultThreadInspectorTests.swift */, @@ -4824,6 +4818,7 @@ F4FE9E062E6248BB0014FED5 /* SentryCrash */ = { isa = PBXGroup; children = ( + FAAB96122EA31F9E0030A2DB /* SentryDebugImageProvider.swift */, FAB0077B2EA01B95001C806A /* SentryCrashSwift.swift */, FA8AFCE72E8434A0007A0E18 /* SentryThreadInspector.swift */, FAE579C62E7DE14400B710F9 /* SentryFrameRemover.swift */, @@ -5199,7 +5194,7 @@ 7DC8310A2398283C0043DD9A /* SentryCrashIntegration.h in Headers */, 63FE718320DA4C1100CDBAE8 /* SentryCrashReportFixer.h in Headers */, 03F84D2027DD414C008FE43F /* SentryStackBounds.hpp in Headers */, - 6273513F2CBD14970021D100 /* SentryDebugImageProvider+HybridSDKs.h in Headers */, + 6273513F2CBD14970021D100 /* SentryDebugImageProviderInternal.h in Headers */, 8E5D38E3261D4B57000D363D /* SentryPerformanceTrackingIntegration.h in Headers */, 63FE70F920DA4C1000CDBAE8 /* SentryCrashMonitor.h in Headers */, D8BD2E6829361A0F00D96C6A /* PrivatesHeader.h in Headers */, @@ -5248,7 +5243,6 @@ 62E081A929ED4260000F69FC /* SentryBreadcrumbDelegate.h in Headers */, 15360CF02433A16D00112302 /* SentryInstallation.h in Headers */, 63FE714720DA4C1100CDBAE8 /* SentryCrashMachineContext.h in Headers */, - 7BA61CAB247BA98100C130A8 /* SentryDebugImageProvider.h in Headers */, 7BC63F0828081242009D9E37 /* SentrySwizzleWrapperHelper.h in Headers */, 638DC9A01EBC6B6400A66E41 /* SentryRequestOperation.h in Headers */, 6344DDB01EC308E400D9160D /* SentryCrashInstallationReporter.h in Headers */, @@ -5782,7 +5776,7 @@ 62C1AFAB2B7E10EA0038C5F7 /* SentrySpotlightTransport.m in Sources */, 7B5CAF7727F5A68C00ED0DB6 /* SentryNSURLRequestBuilder.m in Sources */, 639FCFA11EBC804600778193 /* SentryException.m in Sources */, - 7BA61CAD247BAA0B00C130A8 /* SentryDebugImageProvider.m in Sources */, + 7BA61CAD247BAA0B00C130A8 /* SentryDebugImageProviderInternal.m in Sources */, 63FE70E720DA4C1000CDBAE8 /* SentryCrashMonitor.c in Sources */, 84354E1229BF944900CDBB8B /* SentryProfileTimeseries.m in Sources */, FA94E6912E6B92C100576666 /* SentryClientReport.swift in Sources */, @@ -5853,6 +5847,7 @@ 63295AF71EF3C7DB002D4490 /* SentryNSDictionarySanitize.m in Sources */, 7B8ECBFC26498958005FE2EF /* SentryDefaultAppStateManager.m in Sources */, FA67DCF52DDBD4EA00896B02 /* SentryCurrentDateProvider.swift in Sources */, + FAAB96132EA31FA20030A2DB /* SentryDebugImageProvider.swift in Sources */, FA67DCF62DDBD4EA00896B02 /* SentryViewRenderer.swift in Sources */, FA67DCF72DDBD4EA00896B02 /* SentryDefaultMaskRenderer.swift in Sources */, FA67DCF82DDBD4EA00896B02 /* SentryProfileOptions.swift in Sources */, @@ -6386,7 +6381,6 @@ 8EAC7FF8265C8910005B44E5 /* SentryTracerTests.swift in Sources */, 0A1B497328E597DD00D7BFA3 /* TestLogOutput.swift in Sources */, D8CB742E294B294B00A5F964 /* MockUIScene.m in Sources */, - 7BA61CBD247BC6B900C130A8 /* TestSentryCrashBinaryImageProvider.swift in Sources */, D48724E22D354D16005DE483 /* SentryTraceOriginTests.swift in Sources */, 7BFA69F627E0840400233199 /* SentryANRTrackingIntegrationTests.swift in Sources */, 7BBD18B62451807600427C76 /* SentryDefaultRateLimitsTests.swift in Sources */, diff --git a/SentryTestUtils/SentryTestUtils-ObjC-BridgingHeader.h b/SentryTestUtils/SentryTestUtils-ObjC-BridgingHeader.h index 5b595aa7d0c..a4de417e0f4 100644 --- a/SentryTestUtils/SentryTestUtils-ObjC-BridgingHeader.h +++ b/SentryTestUtils/SentryTestUtils-ObjC-BridgingHeader.h @@ -29,7 +29,6 @@ #import "SentryCrashCachedData.h" #import "SentryCrashInstallation+Private.h" #import "SentryCrashMonitor_MachException.h" -#import "SentryDebugImageProvider+HybridSDKs.h" #import "SentryDefaultThreadInspector.h" #import "SentryDependencyContainer.h" #import "SentryFileManager+Test.h" diff --git a/SentryTestUtils/TestDebugImageProvider.swift b/SentryTestUtils/TestDebugImageProvider.swift index e55ae556ec6..325b675d0f2 100644 --- a/SentryTestUtils/TestDebugImageProvider.swift +++ b/SentryTestUtils/TestDebugImageProvider.swift @@ -1,19 +1,9 @@ import _SentryPrivate import Foundation -@testable import Sentry +@_spi(Private) @testable import Sentry -public class TestDebugImageProvider: SentryDebugImageProvider { +@_spi(Private) public class TestDebugImageProvider: SentryDebugImageProvider { public var debugImages: [DebugMeta]? - - @available(*, deprecated) - public override func getDebugImages() -> [DebugMeta] { - getDebugImagesCrashed(true) - } - - @available(*, deprecated) - public override func getDebugImagesCrashed(_ isCrash: Bool) -> [DebugMeta] { - debugImages ?? super.getDebugImagesCrashed(isCrash) - } public var getDebugImagesFromCacheForFramesInvocations = Invocations() public override func getDebugImagesFromCacheForFrames(frames: [Frame]) -> [DebugMeta] { diff --git a/Sources/Resources/Sentry.modulemap b/Sources/Resources/Sentry.modulemap index d06c783e99f..78e642066f0 100644 --- a/Sources/Resources/Sentry.modulemap +++ b/Sources/Resources/Sentry.modulemap @@ -10,7 +10,6 @@ framework module Sentry { header "PrivatesHeader.h" header "SentryAppStartMeasurement.h" header "SentryBreadcrumb+Private.h" - header "SentryDebugImageProvider+HybridSDKs.h" header "SentryDependencyContainer.h" header "SentryFormatter.h" header "SentryOptionsInternal.h" diff --git a/Sources/Sentry/PrivateSentrySDKOnly.m b/Sources/Sentry/PrivateSentrySDKOnly.m index 68aefee073a..2e49ad78c1b 100644 --- a/Sources/Sentry/PrivateSentrySDKOnly.m +++ b/Sources/Sentry/PrivateSentrySDKOnly.m @@ -2,8 +2,6 @@ #import "SentryAppStartMeasurement.h" #import "SentryBreadcrumb+Private.h" #import "SentryClient.h" -#import "SentryDebugImageProvider+HybridSDKs.h" -#import "SentryDebugImageProvider.h" #import "SentryHub+Private.h" #import "SentryInstallation.h" #import "SentryInternalDefines.h" @@ -50,23 +48,6 @@ + (nullable SentryEnvelope *)envelopeWithData:(NSData *)data return [SentrySerializationSwift envelopeWithData:data]; } -#if !SDK_V9 -+ (NSArray *)getDebugImages -{ - // maintains previous behavior for the same method call by also trying to gather crash info - return [self getDebugImagesCrashed:YES]; -} - -+ (NSArray *)getDebugImagesCrashed:(BOOL)isCrash -{ -# pragma clang diagnostic push -# pragma clang diagnostic ignored "-Wdeprecated-declarations" - return [[SentryDependencyContainer sharedInstance].debugImageProvider - getDebugImagesCrashed:isCrash]; -# pragma clang diagnostic pop -} -#endif // !SDK_V9 - + (nullable SentryAppStartMeasurement *)appStartMeasurement { return [SentrySDKInternal getAppStartMeasurement]; diff --git a/Sources/Sentry/Profiling/SentryProfilerSerialization.m b/Sources/Sentry/Profiling/SentryProfilerSerialization.m index d0659dec08c..1aee430abed 100644 --- a/Sources/Sentry/Profiling/SentryProfilerSerialization.m +++ b/Sources/Sentry/Profiling/SentryProfilerSerialization.m @@ -4,7 +4,6 @@ # import "SentryClient+Private.h" # import "SentryDateUtils.h" -# import "SentryDebugImageProvider+HybridSDKs.h" # import "SentryDependencyContainer.h" # import "SentryDevice.h" # import "SentryEnvelopeItemHeader.h" diff --git a/Sources/Sentry/Public/Sentry.h b/Sources/Sentry/Public/Sentry.h index d1f1919853b..905baf336d3 100644 --- a/Sources/Sentry/Public/Sentry.h +++ b/Sources/Sentry/Public/Sentry.h @@ -12,7 +12,6 @@ FOUNDATION_EXPORT const unsigned char SentryVersionString[]; # import # import # import -# import # import # import # import diff --git a/Sources/Sentry/Public/SentryDebugImageProvider.h b/Sources/Sentry/Public/SentryDebugImageProvider.h deleted file mode 100644 index e54ee9b20e7..00000000000 --- a/Sources/Sentry/Public/SentryDebugImageProvider.h +++ /dev/null @@ -1,93 +0,0 @@ -#if !SDK_V9 - -# import - -@class SentryDebugMeta; -@class SentryFrame; -@class SentryThread; - -NS_ASSUME_NONNULL_BEGIN - -/** - * Reserved for hybrid SDKs that need the debug images for symbolication. - */ -@interface SentryDebugImageProvider : NSObject - -- (instancetype)init; - -/** - * Returns a list of debug images that are being referenced in the given threads. - * @param threads A list of @c SentryThread that may or may not contain stacktraces. - * @warning This assumes a crash has occurred and attempts to read the crash information from each - * image's data segment, which may not be present or be invalid if a crash has not actually - * occurred. To avoid this, use the new @c -[getDebugImagesForThreads:isCrash:] instead. - * @deprecated Use @c -[getDebugImagesForThreads:isCrash:] instead. - */ -- (NSArray *)getDebugImagesForThreads:(NSArray *)threads - DEPRECATED_MSG_ATTRIBUTE("Use -[getDebugImagesForThreads:isCrash:] instead."); - -/** - * Returns a list of debug images that are being referenced in the given threads. - * @param threads A list of @c SentryThread that may or may not contain stacktraces. - * @param isCrash @c YES if we're collecting binary images for a crash report, @c NO if we're - * gathering them for other backtrace information, like a performance transaction. If this is for a - * crash, each image's data section crash info is also included. - */ -- (NSArray *)getDebugImagesForThreads:(NSArray *)threads - isCrash:(BOOL)isCrash - DEPRECATED_MSG_ATTRIBUTE("This method is slow and will be removed in a future version. Use " - "-[getDebugImagesFromCacheForThreads:] instead."); -; - -/** - * Returns a list of debug images that are being referenced by the given frames. - * @param frames A list of stack frames. - * @warning This assumes a crash has occurred and attempts to read the crash information from each - * image's data segment, which may not be present or be invalid if a crash has not actually - * occurred. To avoid this, use the new @c -[getDebugImagesForFrames:isCrash:] instead. - * @deprecated Use @c -[getDebugImagesForFrames:isCrash:] instead. - */ -- (NSArray *)getDebugImagesForFrames:(NSArray *)frames - DEPRECATED_MSG_ATTRIBUTE("Use -[getDebugImagesForFrames:isCrash:] instead."); - -/** - * Returns a list of debug images that are being referenced by the given frames. - * @param frames A list of stack frames. - * @param isCrash @c YES if we're collecting binary images for a crash report, @c NO if we're - * gathering them for other backtrace information, like a performance transaction. If this is for a - * crash, each image's data section crash info is also included. - */ -- (NSArray *)getDebugImagesForFrames:(NSArray *)frames - isCrash:(BOOL)isCrash - DEPRECATED_MSG_ATTRIBUTE("This method is slow and will be removed in a future version. Use " - "-[getDebugImagesFromCacheForFrames:] instead."); - -/** - * Returns the current list of debug images. Be aware that the @c SentryDebugMeta is actually - * describing a debug image. - * @warning This assumes a crash has occurred and attempts to read the crash information from each - * image's data segment, which may not be present or be invalid if a crash has not actually - * occurred. To avoid this, use the new @c -[getDebugImagesCrashed:] instead. - * @deprecated Use @c -[getDebugImagesCrashed:] instead. - */ -- (NSArray *)getDebugImages DEPRECATED_MSG_ATTRIBUTE( - "Use -[getDebugImagesCrashed:] instead."); - -/** - * Returns the current list of debug images. Be aware that the @c SentryDebugMeta is actually - * describing a debug image. - * @param isCrash @c YES if we're collecting binary images for a crash report, @c NO if we're - * gathering them for other backtrace information, like a performance transaction. If this is for a - * crash, each image's data section crash info is also included. - * - * @warning This method is slow. Please consider using @c getDebugImagesFromCache. - */ -- (NSArray *)getDebugImagesCrashed:(BOOL)isCrash - DEPRECATED_MSG_ATTRIBUTE("This method is slow and will be removed in a future version. Use " - "-[getDebugImagesFromCache:] instead."); - -@end - -NS_ASSUME_NONNULL_END - -#endif // !SDK_V9 diff --git a/Sources/Sentry/Public/SentryWithoutUIKit.h b/Sources/Sentry/Public/SentryWithoutUIKit.h index 508d9b09348..1b9597110a7 100644 --- a/Sources/Sentry/Public/SentryWithoutUIKit.h +++ b/Sources/Sentry/Public/SentryWithoutUIKit.h @@ -13,7 +13,6 @@ FOUNDATION_EXPORT const unsigned char SentryVersionString[]; # import # import # import -# import # import # import # import diff --git a/Sources/Sentry/SentryANRTrackingIntegration.m b/Sources/Sentry/SentryANRTrackingIntegration.m index 891ab139289..a56f823cd21 100644 --- a/Sources/Sentry/SentryANRTrackingIntegration.m +++ b/Sources/Sentry/SentryANRTrackingIntegration.m @@ -1,6 +1,5 @@ #import "SentryANRTrackingIntegration.h" #import "SentryCrashMachineContext.h" -#import "SentryDebugImageProvider+HybridSDKs.h" #import "SentryDependencyContainer.h" #import "SentryEvent.h" #import "SentryException.h" diff --git a/Sources/Sentry/SentryClient.m b/Sources/Sentry/SentryClient.m index 9bdcc24f124..62649af2f89 100644 --- a/Sources/Sentry/SentryClient.m +++ b/Sources/Sentry/SentryClient.m @@ -5,7 +5,6 @@ #import "SentryCrashDefaultMachineContextWrapper.h" #import "SentryCrashIntegration.h" #import "SentryCrashStackEntryMapper.h" -#import "SentryDebugImageProvider+HybridSDKs.h" #import "SentryDefaultThreadInspector.h" #import "SentryDependencyContainer.h" #import "SentryDeviceContextKeys.h" diff --git a/Sources/Sentry/SentryDebugImageProvider.m b/Sources/Sentry/SentryDebugImageProviderInternal.m similarity index 50% rename from Sources/Sentry/SentryDebugImageProvider.m rename to Sources/Sentry/SentryDebugImageProviderInternal.m index ff06cd148c7..3ff28f88a7e 100644 --- a/Sources/Sentry/SentryDebugImageProvider.m +++ b/Sources/Sentry/SentryDebugImageProviderInternal.m @@ -1,8 +1,4 @@ -#import "SentryDebugImageProvider.h" -#import "SentryDebugImageProvider+HybridSDKs.h" -#if !SDK_V9 -# import "SentryCrashDefaultBinaryImageProvider.h" -#endif // !SDK_V9 +#import "SentryDebugImageProviderInternal.h" #import "SentryCrashDynamicLinker.h" #import "SentryCrashUUIDConversion.h" #import "SentryDebugMeta.h" @@ -18,46 +14,31 @@ NS_ASSUME_NONNULL_BEGIN -@interface SentryDebugImageProvider () +@interface SentryDebugImageProviderInternal () -#if !SDK_V9 -@property (nonatomic, strong) id binaryImageProvider; -#endif // !SDK_V9 @property (nonatomic, strong) SentryBinaryImageCache *binaryImageCache; @end -@implementation SentryDebugImageProvider +@implementation SentryDebugImageProviderInternal - (instancetype)init { -#if SDK_V9 self = [self initWithBinaryImageCache:SentryDependencyContainer.sharedInstance.binaryImageCache]; -#else - SentryCrashDefaultBinaryImageProvider *provider = - [[SentryCrashDefaultBinaryImageProvider alloc] init]; - self = [self - initWithBinaryImageProvider:provider - binaryImageCache:SentryDependencyContainer.sharedInstance.binaryImageCache]; -#endif // SDK_V9 return self; } /** Internal constructor for testing */ -#if SDK_V9 -- (instancetype)initWithBinaryImageCache:(SentryBinaryImageCache *)binaryImageCache -#else -- (instancetype)initWithBinaryImageProvider:(id)binaryImageProvider - binaryImageCache:(SentryBinaryImageCache *)binaryImageCache -#endif // SDK_V9 +- (instancetype)initWithBinaryImageCache:(SentryBinaryImageCache *_Nullable)binaryImageCache { if (self = [super init]) { -#if !SDK_V9 - self.binaryImageProvider = binaryImageProvider; -#endif // !SDK_V9 - self.binaryImageCache = binaryImageCache; + if (binaryImageCache) { + self.binaryImageCache = (SentryBinaryImageCache *)binaryImageCache; + } else { + self.binaryImageCache = SentryDependencyContainer.sharedInstance.binaryImageCache; + } } return self; } @@ -72,86 +53,6 @@ - (void)extractDebugImageAddressFromFrames:(NSArray *)frames } } -#if !SDK_V9 - -- (NSArray *)getDebugImagesForAddresses:(NSSet *)addresses - isCrash:(BOOL)isCrash -{ - NSMutableArray *result = [NSMutableArray array]; - -# pragma clang diagnostic push -# pragma clang diagnostic ignored "-Wdeprecated-declarations" - NSArray *binaryImages = [self getDebugImagesCrashed:isCrash]; -# pragma clang diagnostic pop - - for (SentryDebugMeta *sourceImage in binaryImages) { - if (sourceImage.imageAddress && - [addresses containsObject:SENTRY_UNWRAP_NULLABLE(NSString, sourceImage.imageAddress)]) { - [result addObject:sourceImage]; - } - } - - return result; -} - -- (NSArray *)getDebugImagesForFrames:(NSArray *)frames -{ - // maintains previous behavior for the same method call by also trying to gather crash info - return [self getDebugImagesForFrames:frames isCrash:YES]; -} - -- (NSArray *)getDebugImagesForFrames:(NSArray *)frames - isCrash:(BOOL)isCrash -{ - NSMutableSet *imageAddresses = [[NSMutableSet alloc] init]; - [self extractDebugImageAddressFromFrames:frames intoSet:imageAddresses]; - return [self getDebugImagesForAddresses:imageAddresses isCrash:isCrash]; -} - -- (NSArray *)getDebugImagesForThreads:(NSArray *)threads -{ - // maintains previous behavior for the same method call by also trying to gather crash info - return [self getDebugImagesForThreads:threads isCrash:YES]; -} - -- (NSArray *)getDebugImagesForThreads:(NSArray *)threads - isCrash:(BOOL)isCrash -{ - NSMutableSet *imageAddresses = [[NSMutableSet alloc] init]; - - for (SentryThread *thread in threads) { - NSArray *_Nullable frames = thread.stacktrace.frames; - if (frames != nil) { - [self extractDebugImageAddressFromFrames:SENTRY_UNWRAP_NULLABLE(NSArray, frames) - intoSet:imageAddresses]; - } - } - - return [self getDebugImagesForAddresses:imageAddresses isCrash:isCrash]; -} - -- (NSArray *)getDebugImages -{ - // maintains previous behavior for the same method call by also trying to gather crash info - return [self getDebugImagesCrashed:YES]; -} - -- (NSArray *)getDebugImagesCrashed:(BOOL)isCrash -{ - NSMutableArray *debugMetaArray = [NSMutableArray new]; - - NSInteger imageCount = [self.binaryImageProvider getImageCount]; - for (NSInteger i = 0; i < imageCount; i++) { - SentryCrashBinaryImage image = [self.binaryImageProvider getBinaryImage:i isCrash:isCrash]; - SentryDebugMeta *debugMeta = [self fillDebugMetaFrom:image]; - [debugMetaArray addObject:debugMeta]; - } - - return debugMetaArray; -} - -#endif // !SDK_V9 - - (NSArray *)getDebugImagesForImageAddressesFromCache: (NSSet *)imageAddresses { diff --git a/Sources/Sentry/SentryDependencyContainer.m b/Sources/Sentry/SentryDependencyContainer.m index 7ca423027fd..a52e839f908 100644 --- a/Sources/Sentry/SentryDependencyContainer.m +++ b/Sources/Sentry/SentryDependencyContainer.m @@ -9,7 +9,6 @@ #import "SentrySDK+Private.h" #import "SentrySwift.h" #import "SentrySystemWrapper.h" -#import #import #import #import diff --git a/Sources/Sentry/SentryTracer.m b/Sources/Sentry/SentryTracer.m index c4c7615482f..0efeb081399 100644 --- a/Sources/Sentry/SentryTracer.m +++ b/Sources/Sentry/SentryTracer.m @@ -1,6 +1,5 @@ #import "PrivateSentrySDKOnly.h" #import "SentryClient.h" -#import "SentryDebugImageProvider+HybridSDKs.h" #import "SentryDependencyContainer.h" #import "SentryEvent+Private.h" #import "SentryHub+Private.h" diff --git a/Sources/Sentry/include/HybridPublic/PrivateSentrySDKOnly.h b/Sources/Sentry/include/HybridPublic/PrivateSentrySDKOnly.h index 78fa4d111de..d82a162794c 100644 --- a/Sources/Sentry/include/HybridPublic/PrivateSentrySDKOnly.h +++ b/Sources/Sentry/include/HybridPublic/PrivateSentrySDKOnly.h @@ -50,26 +50,6 @@ typedef void (^SentryOnAppStartMeasurementAvailable)( */ + (nullable SentryEnvelope *)envelopeWithData:(NSData *)data; -#if !SDK_V9 -/** - * Returns the current list of debug images. Be aware that the @c SentryDebugMeta is actually - * describing a debug image. - * @warning This assumes a crash has occurred and attempts to read the crash information from each - * image's data segment, which may not be present or be invalid if a crash has not actually - * occurred. To avoid this, use the new @c +[getDebugImagesCrashed:] instead. - */ -+ (NSArray *)getDebugImages; - -/** - * Returns the current list of debug images. Be aware that the @c SentryDebugMeta is actually - * describing a debug image. - * @param isCrash @c YES if we're collecting binary images for a crash report, @c NO if we're - * gathering them for other backtrace information, like a performance transaction. If this is for a - * crash, each image's data section crash info is also included. - */ -+ (NSArray *)getDebugImagesCrashed:(BOOL)isCrash; -#endif // !SDK_V9 - /** * Override SDK information. */ diff --git a/Sources/Sentry/include/HybridPublic/SentryDebugImageProvider+HybridSDKs.h b/Sources/Sentry/include/SentryDebugImageProviderInternal.h similarity index 85% rename from Sources/Sentry/include/HybridPublic/SentryDebugImageProvider+HybridSDKs.h rename to Sources/Sentry/include/SentryDebugImageProviderInternal.h index 793468086eb..edfb6517763 100644 --- a/Sources/Sentry/include/HybridPublic/SentryDebugImageProvider+HybridSDKs.h +++ b/Sources/Sentry/include/SentryDebugImageProviderInternal.h @@ -1,22 +1,13 @@ -#if __has_include() -# import -#else -# import "SentryDebugImageProvider.h" -#endif - #import @class SentryDebugMeta; +@class SentryBinaryImageCache; @class SentryThread; @class SentryFrame; NS_ASSUME_NONNULL_BEGIN -#if SDK_V9 -@interface SentryDebugImageProvider : NSObject -#else -@interface SentryDebugImageProvider () -#endif +@interface SentryDebugImageProviderInternal : NSObject - (instancetype)init; diff --git a/Sources/Sentry/include/SentryPrivate.h b/Sources/Sentry/include/SentryPrivate.h index 9b9f06fdc89..19fff1509fa 100644 --- a/Sources/Sentry/include/SentryPrivate.h +++ b/Sources/Sentry/include/SentryPrivate.h @@ -30,6 +30,7 @@ #import "SentryCrashMonitor_AppState.h" #import "SentryCrashMonitor_System.h" #import "SentryDateUtils.h" +#import "SentryDebugImageProviderInternal.h" #import "SentryDefaultAppStateManager.h" #import "SentryDefaultThreadInspector.h" #import "SentryDefaultUIViewControllerPerformanceTracker.h" diff --git a/Sources/Swift/SentryCrash/SentryDebugImageProvider.swift b/Sources/Swift/SentryCrash/SentryDebugImageProvider.swift new file mode 100644 index 00000000000..44d842464fb --- /dev/null +++ b/Sources/Swift/SentryCrash/SentryDebugImageProvider.swift @@ -0,0 +1,38 @@ +@_implementationOnly import _SentryPrivate + +@_spi(Private) public class SentryDebugImageProvider: NSObject { + + @objc let helper = SentryDebugImageProviderInternal() + + /** + * Returns a list of debug images that are being referenced by the given frames. + * This function uses the @c SentryBinaryImageCache which is significantly faster than @c + * SentryCrashDefaultBinaryImageProvider for retrieving binary image information. + */ + @objc(getDebugImagesFromCacheForFrames:) public func getDebugImagesFromCacheForFrames(frames: [Frame]) -> [DebugMeta] { + helper.getDebugImagesFromCacheForFrames(frames: frames) + } + + /** + * Returns a list of debug images that are being referenced in the given threads. + * This function uses the @c SentryBinaryImageCache which is significantly faster than @c + * SentryCrashDefaultBinaryImageProvider for retrieving binary image information. + */ + @objc(getDebugImagesFromCacheForThreads:) public func getDebugImagesFromCacheForThreads(threads: [SentryThread]) -> [DebugMeta] { + helper.getDebugImagesFromCacheForThreads(threads: threads) + } + + /** + * Returns a list of debug images that are being referenced in the given image addresses. + * This function uses the @c SentryBinaryImageCache which is significantly faster than @c + * SentryCrashDefaultBinaryImageProvider for retrieving binary image information. + */ + @objc(getDebugImagesForImageAddressesFromCache:) public func getDebugImagesForImageAddressesFromCache(imageAddresses: Set) -> [DebugMeta] { + helper.getDebugImagesForImageAddressesFromCache(imageAddresses: imageAddresses) + } + + @objc public func getDebugImagesFromCache() -> [DebugMeta] { + helper.getDebugImagesFromCache() + } + +} diff --git a/Tests/SentryTests/SentryCrash/SentryDebugImageProvider+TestInit.h b/Tests/SentryTests/SentryCrash/SentryDebugImageProvider+TestInit.h deleted file mode 100644 index c91d50a54f7..00000000000 --- a/Tests/SentryTests/SentryCrash/SentryDebugImageProvider+TestInit.h +++ /dev/null @@ -1,14 +0,0 @@ -#import "SentryDebugImageProvider.h" - -NS_ASSUME_NONNULL_BEGIN - -@class SentryBinaryImageCache; - -@interface SentryDebugImageProvider (TestInit) - -- (instancetype)initWithBinaryImageProvider:(id)binaryImageProvider - binaryImageCache:(SentryBinaryImageCache *)binaryImageCache; - -@end - -NS_ASSUME_NONNULL_END diff --git a/Tests/SentryTests/SentryCrash/SentryDebugImageProviderTests.swift b/Tests/SentryTests/SentryCrash/SentryDebugImageProviderTests.swift index 631f9a4a463..d72772adf11 100644 --- a/Tests/SentryTests/SentryCrash/SentryDebugImageProviderTests.swift +++ b/Tests/SentryTests/SentryCrash/SentryDebugImageProviderTests.swift @@ -16,11 +16,7 @@ class SentryDebugImageProviderTests: XCTestCase { cache = SentryBinaryImageCache() } - func getSut(images: [SentryCrashBinaryImage] = []) -> SentryDebugImageProvider { - let imageProvider = TestSentryCrashBinaryImageProvider() - imageProvider.imageCount = images.count - imageProvider.binaryImage = images - + func getSut(images: [SentryCrashBinaryImage] = []) -> SentryDebugImageProvider { cache.start(false) for image in images { cache.binaryImageAdded(imageName: image.name, @@ -30,7 +26,9 @@ class SentryDebugImageProviderTests: XCTestCase { uuid: image.uuid) } - return SentryDebugImageProvider(binaryImageProvider: imageProvider, binaryImageCache: cache) + let provider = SentryDebugImageProvider() + Dynamic(Dynamic(provider).helper).binaryImageCache = cache + return provider } func getTestImages() -> [SentryCrashBinaryImage] { @@ -78,115 +76,6 @@ class SentryDebugImageProviderTests: XCTestCase { super.tearDown() } - @available(*, deprecated) - func testThreeImages() throws { - let sut = fixture.getSut(images: fixture.getTestImages()) - let actual = sut.getDebugImagesCrashed(false) - - XCTAssertEqual(3, actual.count) - - XCTAssertEqual("dyld_sim", try XCTUnwrap(actual.first).codeFile) - XCTAssertEqual("UIKit", try XCTUnwrap(actual.element(at: 1)).codeFile) - XCTAssertEqual("CoreData", try XCTUnwrap(actual.element(at: 2)).codeFile) - - let debugMeta = try XCTUnwrap(actual.first) - XCTAssertEqual("84BAEBDA-AD1A-33F4-B35D-8A45F5DAF322", debugMeta.debugID) - XCTAssertEqual("0x0000000105705000", debugMeta.imageAddress) - XCTAssertEqual("0x00007fff51af0000", debugMeta.imageVmAddress) - XCTAssertEqual("macho", debugMeta.type) - XCTAssertEqual(352_256, debugMeta.imageSize) - } - - @available(*, deprecated) - func testImageVmAddressIsZero() { - let image = SentryDebugImageProviderTests.createSentryCrashBinaryImage(vmAddress: 0) - - let sut = fixture.getSut(images: [image]) - let actual = sut.getDebugImagesCrashed(false) - - XCTAssertNil(try XCTUnwrap(actual.first).imageVmAddress) - } - - @available(*, deprecated) - func testImageSize() { - func testWith(value: UInt64) { - let image = SentryDebugImageProviderTests.createSentryCrashBinaryImage(size: value) - let sut = fixture.getSut(images: [image]) - let actual = sut.getDebugImagesCrashed(false) - XCTAssertEqual(NSNumber(value: value), try XCTUnwrap(actual.first).imageSize) - } - - testWith(value: 0) - testWith(value: 1_000) - testWith(value: UINT64_MAX) - } - - @available(*, deprecated) - func testImageAddress() throws { - func testWith(value: UInt64, expected: String) throws { - let image = SentryDebugImageProviderTests.createSentryCrashBinaryImage(address: value) - let sut = fixture.getSut(images: [image]) - let actual = sut.getDebugImagesCrashed(false) - - XCTAssertEqual(1, actual.count) - - let debugMeta = try XCTUnwrap(actual.first) - XCTAssertEqual(expected, debugMeta.imageAddress) - } - - try testWith(value: UINT64_MAX, expected: "0xffffffffffffffff") - try testWith(value: 0, expected: "0x0000000000000000") - try testWith(value: 0, expected: "0x0000000000000000") - try testWith(value: 4_361_940_992, expected: "0x0000000103fdf000") - } - - @available(*, deprecated) - func testNoImages() { - let actual = fixture.getSut().getDebugImagesCrashed(false) - - XCTAssertEqual(0, actual.count) - } - - @available(*, deprecated) - func testImagesForThreads() { - let sut = fixture.getSut(images: fixture.getTestImages()) - - let thread = SentryThread(threadId: NSNumber(value: 1)) - let frame = Sentry.Frame() - frame.imageAddress = "0x0000000105705000" - thread.stacktrace = SentryStacktrace(frames: [frame], registers: [:]) - - var actual = sut.getDebugImages(for: [thread], isCrash: false) - - XCTAssertEqual(actual.count, 1) - XCTAssertEqual(try XCTUnwrap(actual.first).codeFile, "dyld_sim") - XCTAssertEqual(try XCTUnwrap(actual.first).imageAddress, "0x0000000105705000") - - let frame2 = Sentry.Frame() - frame2.imageAddress = "0x00000001410b1a00" - let frame3 = Sentry.Frame() - frame3.imageAddress = "0x000000017ca5e400" - thread.stacktrace = SentryStacktrace(frames: [frame2, frame3], registers: [:]) - - actual = sut.getDebugImages(for: [thread], isCrash: false) - - XCTAssertEqual(actual.count, 2) - XCTAssertEqual(try XCTUnwrap(actual.first).codeFile, "UIKit") - XCTAssertEqual(try XCTUnwrap(actual.first).imageAddress, "0x00000001410b1a00") - - XCTAssertEqual(try XCTUnwrap(actual.element(at: 1)).codeFile, "CoreData") - XCTAssertEqual(try XCTUnwrap(actual.element(at: 1)).imageAddress, "0x000000017ca5e400") - } - - @available(*, deprecated) - func test_NoImage_ForThread_WithoutStackTrace() { - let sut = fixture.getSut(images: fixture.getTestImages()) - let thread = SentryThread(threadId: NSNumber(value: 1)) - let actual = sut.getDebugImages(for: [thread], isCrash: false) - - XCTAssertEqual(actual.count, 0) - } - func testGetDebugImagesFromCacheForThreads() throws { let sut = fixture.getSut(images: fixture.getTestImages()) diff --git a/Tests/SentryTests/SentryCrash/TestSentryCrashBinaryImageProvider.swift b/Tests/SentryTests/SentryCrash/TestSentryCrashBinaryImageProvider.swift deleted file mode 100644 index 5bbb4dde540..00000000000 --- a/Tests/SentryTests/SentryCrash/TestSentryCrashBinaryImageProvider.swift +++ /dev/null @@ -1,19 +0,0 @@ -import Foundation - -@objc -public class TestSentryCrashBinaryImageProvider: NSObject, SentryCrashBinaryImageProvider { - - var binaryImage: [SentryCrashBinaryImage] = [] - public func getBinaryImage(_ index: Int) -> SentryCrashBinaryImage { - getBinaryImage(index, isCrash: true) - } - - public func getBinaryImage(_ index: Int, isCrash: Bool) -> SentryCrashBinaryImage { - binaryImage[Int(index)] - } - - var imageCount = Int(0) - public func getImageCount() -> Int { - imageCount - } -} diff --git a/Tests/SentryTests/SentryTests-Bridging-Header.h b/Tests/SentryTests/SentryTests-Bridging-Header.h index b9f690dbc87..90c4790ebf5 100644 --- a/Tests/SentryTests/SentryTests-Bridging-Header.h +++ b/Tests/SentryTests/SentryTests-Bridging-Header.h @@ -97,8 +97,6 @@ #import "SentryDataCategory.h" #import "SentryDataCategoryMapper.h" #import "SentryDateUtils.h" -#import "SentryDebugImageProvider+HybridSDKs.h" -#import "SentryDebugImageProvider+TestInit.h" #import "SentryDebugMeta.h" #import "SentryDefaultAppStateManager.h" #import "SentryDefaultThreadInspector.h" diff --git a/sdk_api.json b/sdk_api.json index d506d916481..186edcb5a75 100644 --- a/sdk_api.json +++ b/sdk_api.json @@ -64,16 +64,6 @@ "Exported" ] }, - { - "kind": "Import", - "name": "Sentry.SentryDebugImageProvider", - "printedName": "Sentry.SentryDebugImageProvider", - "declKind": "Import", - "moduleName": "Sentry", - "declAttributes": [ - "Exported" - ] - }, { "kind": "Import", "name": "Sentry.SentryDebugMeta",