-
Notifications
You must be signed in to change notification settings - Fork 24
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
demangle Swift support #16
Comments
Where is SWIFT mangling documented? Thanks. |
❯ cat greet.swift
func greet() {
print("Hello World!")
}
greet() ❯ swiftc greet.swift # compile ❯ nm greet
0000000100003db4 t _$s5greetAAyyF
U _$sSS21_builtinStringLiteral17utf8CodeUnitCount7isASCIISSBp_BwBi1_tcfC
U _$sSSN
0000000100003f34 t _$sSa12_endMutationyyF
U _$sSaMa
U _$ss27_allocateUninitializedArrayySayxG_BptBwlF
0000000100003e80 t _$ss27_finalizeUninitializedArrayySayxGABnlF
U _$ss5print_9separator10terminatoryypd_S2StF
0000000100003edc t _$ss5print_9separator10terminatoryypd_S2StFfA0_
0000000100003f08 t _$ss5print_9separator10terminatoryypd_S2StFfA1_
U _$sypN
0000000100003fa0 s ___swift_reflection_version
0000000100000000 T __mh_execute_header
0000000100003d9c T _main
U _swift_bridgeObjectRelease
U _swift_bridgeObjectRetain ❯ nm greet | xcrun swift-demangle
0000000100003db4 t greet.greet() -> ()
U Swift.String.init(_builtinStringLiteral: Builtin.RawPointer, utf8CodeUnitCount: Builtin.Word, isASCII: Builtin.Int1) -> Swift.String
U type metadata for Swift.String
0000000100003f34 t Swift.Array._endMutation() -> ()
U type metadata accessor for Swift.Array
U Swift._allocateUninitializedArray<A>(Builtin.Word) -> ([A], Builtin.RawPointer)
0000000100003e80 t Swift._finalizeUninitializedArray<A>(__owned [A]) -> [A]
U Swift.print(_: Any..., separator: Swift.String, terminator: Swift.String) -> ()
0000000100003edc t default argument 1 of Swift.print(_: Any..., separator: Swift.String, terminator: Swift.String) -> ()
0000000100003f08 t default argument 2 of Swift.print(_: Any..., separator: Swift.String, terminator: Swift.String) -> ()
U type metadata for Any
0000000100003fa0 s ___swift_reflection_version
0000000100000000 T __mh_execute_header
0000000100003d9c T _main
U _swift_bridgeObjectRelease
U _swift_bridgeObjectRetain |
Thanks. That appears to be code that implements demangling. Is there any written documentation separate from code? For example, C++ mangling is defined at https://itanium-cxx-abi.github.io/cxx-abi/abi.html#mangling. |
Do you need any more info? Thanks! |
I'm sorry, I don't know when I'll have time to work on this. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Would it be possible to add pure Go Swift demangle support?
The text was updated successfully, but these errors were encountered: