ObjCGraphView
ObjCGraphView copied to clipboard
Add support for swift apps
I tried this on a swift iOS app and it didn't work
First issue is that the __objc_classname and __objc_methtype sections don't exist in the sections:
>>> bv.sections.keys()
dict_keys(['.extern', '__bss', '__common', '__const', '__const#19', '__cstring', '__data', '__eh_frame', '__got', '__la_symbol_ptr', '__objc_classlist', '__objc_classrefs', '__objc_const', '__objc_data', '__objc_imageinfo', '__objc_methname', '__objc_selrefs', '__stub_helper', '__stubs', '__swift5_assocty', '__swift5_builtin', '__swift5_capture', '__swift5_fieldmd', '__swift5_proto', '__swift5_protos', '__swift5_reflstr', '__swift5_typeref', '__swift5_types', '__text', '__unwind_info'])
it would appear that __objc_classlist is the section that contains references to the objective-C class information. There are also many sections that hold information about swift metadata, but I am still learning how to pull them apart.
It appears that swift name mangling follows different rules that are currently supported. Some examples:
$ echo '_$sypSgWOb' | xcrun swift-demangle
outlined init with take of Any?
$ echo '_$sSo10CFErrorRefaMa' | xcrun swift-demangle
type metadata accessor for __C.CFErrorRef