Skip to content

Provide interface to access debug image cache in SentryObjC wrapper #8039

@limbonaut

Description

@limbonaut

Integrating SentryObjC wrapper in the Godot SDK in getsentry/sentry-godot#755 and this surfaced as a blocker.

The Godot .NET layer needs to resolve instruction addresses to debug images (code file, debug UUID, etc.) for C# exception symbolication.

With Sentry-Dynamic package we used the following SPI:

SentryBinaryImageCache *cache = SentryDependencies.binaryImageCache;
SentryBinaryImageInfo *info = [cache imageByAddress:(uint64_t)address];

Full source context: https://github.com/getsentry/sentry-godot/blob/02eb0219ec6ec3bb0725ad3bc6f68da9a1af4bca/src/sentry/cocoa/cocoa_debug_images.mm#L7-L32

This is similar to approach used in the upstream .NET SDK:

Neither SentryDependencies, SentryBinaryImageCache, nor SentryBinaryImageInfo exist in the SentryObjC wrapper headers (9.16.1 and 9.17.0). However, the corresponding symbols are present and the classes are in the binary.

Not having this functionality currently degrades .NET exception symbolication on iOS - stack frames are missing line numbers and source context can't resolve. We can technically reach these classes by recreating the header, but that would be brittle in the long run.

Proposal: Expose these types in the private hybrid-sdk header, unless making them public is more desirable.

Alternative: Provide an alternative way to query cached debug images by int64 image address via private hybrid-sdk header.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions