Skip to content

Commit be8375a

Browse files
authored
ref: Migrate SentryBinaryImageCache to Swift (#5995)
* ref: Migrate `SentryBinaryImageCache` to Swift * Fix compile on xrOS * Move headers to include folder * Update sdk json * Use `SentryDependencyContainerSwiftHelper` for the dispatchQueueWrapper * Update SDK api json * Revert to use binary image callbacks in C * Move `SentryBinaryImageCacheCallbacks` to include folder * Fix duplicate files * Use `@_spi(Private)` and `final` for * Refactor `imageByAddress` method to simplify index check and update return value in `SentryBinaryImageCache` * Fix PR review comments * Revert to use `self.cache?.insert` * Revert unmutated variable to use let
1 parent 1b008ee commit be8375a

25 files changed

+415
-406
lines changed

Sentry.xcodeproj/project.pbxproj

Lines changed: 19 additions & 15 deletions
Large diffs are not rendered by default.

SentryTestUtils/SentryTestUtils-ObjC-BridgingHeader.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@
2525

2626
#import "PrivateSentrySDKOnly.h"
2727
#import "SentryAppStartMeasurement.h"
28-
#import "SentryBinaryImageCache.h"
2928
#import "SentryClient+Private.h"
3029
#import "SentryClient+TestInit.h"
3130
#import "SentryCrash+Test.h"

Sources/Resources/Sentry.modulemap

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ framework module Sentry {
99
header "PrivateSentrySDKOnly.h"
1010
header "PrivatesHeader.h"
1111
header "SentryAppStartMeasurement.h"
12-
header "SentryBinaryImageCache.h"
1312
header "SentryBreadcrumb+Private.h"
1413
header "SentryDebugImageProvider+HybridSDKs.h"
1514
header "SentryDependencyContainer.h"

Sources/Sentry/SentryBinaryImageCache.m

Lines changed: 0 additions & 197 deletions
This file was deleted.

Sources/Sentry/SentryCrashStackEntryMapper.m

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
#import "SentryCrashStackEntryMapper.h"
2-
#import "SentryBinaryImageCache.h"
32
#import "SentryDependencyContainer.h"
43
#import "SentryFormatter.h"
54
#import "SentryFrame.h"
@@ -42,7 +41,7 @@ - (SentryFrame *)sentryCrashStackEntryToSentryFrame:(SentryCrashStackEntry)stack
4241
// we get image from the cache.
4342
if (stackEntry.imageAddress == 0 && stackEntry.imageName == NULL) {
4443
SentryBinaryImageInfo *info = [SentryDependencyContainer.sharedInstance.binaryImageCache
45-
imageByAddress:stackEntry.address];
44+
imageByAddress:(uint64_t)stackEntry.address];
4645

4746
frame.imageAddress = sentry_formatHexAddressUInt64(info.address);
4847
frame.package = info.name;

Sources/Sentry/SentryDebugImageProvider.m

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
#import "SentryDebugImageProvider.h"
2-
#import "SentryBinaryImageCache.h"
32
#import "SentryDebugImageProvider+HybridSDKs.h"
43
#if !SDK_V9
54
# import "SentryCrashDefaultBinaryImageProvider.h"
@@ -13,6 +12,7 @@
1312
#import "SentryInternalDefines.h"
1413
#import "SentryLogC.h"
1514
#import "SentryStacktrace.h"
15+
#import "SentrySwift.h"
1616
#import "SentryThread.h"
1717
#import <Foundation/Foundation.h>
1818

@@ -228,7 +228,7 @@ - (SentryDebugMeta *)fillDebugMetaFrom:(SentryCrashBinaryImage)image
228228
- (SentryDebugMeta *)fillDebugMetaFromBinaryImageInfo:(SentryBinaryImageInfo *)info
229229
{
230230
SentryDebugMeta *debugMeta = [[SentryDebugMeta alloc] init];
231-
debugMeta.debugID = info.UUID;
231+
debugMeta.debugID = info.uuid;
232232
debugMeta.type = SentryDebugImageType;
233233

234234
if (info.vmAddress > 0) {

Sources/Sentry/SentryDependencyContainer.m

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
#import "SentryANRTrackerV1.h"
22

33
#import "SentryApplication.h"
4-
#import "SentryBinaryImageCache.h"
54
#import "SentryDefaultObjCRuntimeWrapper.h"
65
#import "SentryDispatchFactory.h"
76
#import "SentryDisplayLinkWrapper.h"

Sources/Sentry/SentrySDKInternal.m

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
#import "SentryANRTrackingIntegration.h"
44
#import "SentryAppStartMeasurement.h"
55
#import "SentryAppStateManager.h"
6-
#import "SentryBinaryImageCache.h"
76
#import "SentryBreadcrumb.h"
87
#import "SentryClient+Private.h"
98
#import "SentryCrash.h"

Sources/Sentry/SentryUIViewControllerSwizzling.m

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
#if SENTRY_HAS_UIKIT
44

5-
# import "SentryBinaryImageCache.h"
65
# import "SentryDefaultObjCRuntimeWrapper.h"
76
# import "SentryDefines.h"
87
# import "SentryDependencyContainer.h"

Sources/Sentry/include/HybridPublic/SentryBinaryImageCache.h

Lines changed: 0 additions & 35 deletions
This file was deleted.

0 commit comments

Comments
 (0)