Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[SR-10430] Need a way to know which image on disk a class is from #3453

Open
millenomi opened this issue Apr 9, 2019 · 3 comments
Open

[SR-10430] Need a way to know which image on disk a class is from #3453

millenomi opened this issue Apr 9, 2019 · 3 comments

Comments

@millenomi
Copy link
Contributor

Previous ID SR-10430
Radar None
Original Reporter @millenomi
Type Bug
Additional Detail from JIRA
Votes 0
Component/s Foundation
Labels Bug
Assignee None
Priority Medium

md5: 8f9632f47485f4d3f6d48cdb3e059964

blocks:

  • SR-10361 Parity: Bundle.init(for: AnyClass)

Issue Description:

To correct some of Bundle's swift-corelibs-foundation shortcomings, it would be useful to have a way to know, given an **AnyClass, which image on disk it is from.

@belkadan
Copy link

belkadan commented Apr 9, 2019

dladdr will do this, although IIRC it's not very efficient about it.

@millenomi
Copy link
Contributor Author

This has two parts: getting an appropriate symbol for the class that is known to originate in the image, and then using it. The first bit requires some stdlib support.

@belkadan
Copy link

belkadan commented Apr 9, 2019

Ah, gotcha. The appropriate symbol is the "nominal type descriptor", but the stdlib doesn't provide an easy way to get at that.

@swift-ci swift-ci transferred this issue from apple/swift-issues Apr 25, 2022
@shahmishal shahmishal transferred this issue from apple/swift May 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants