Why are symbols for classes written in Swift difficult to read in lldb? Is it possible to change this?

末鹿安然 提交于 2019-12-11 17:42:41

问题


Some context, I'm new to swift, going through a book right now

When looking at exceptions in lldb, when there's a stack frame from a Swift class, the symbol is very hard to read

ex: _TFC10MyApp16TestViewControllersP01CBLDocumentModel5queryfzT4viewCSo7CBLView4

it looks like lldb just doesn't know how to display the signatures properly-- is there a flag or setting I can change? Or is just a thing that everybody has learned to deal with?

Really the difficult part, for me, is when it prints random letters in the middle of the symbol


回答1:


This has nothing to do with lldb, it’s called name mangling in Swift, and the symbols have very specific meanings. Swift’s name mangling is specifically designed so that the mangled name can be deterministically reconstructed to provide information about the kind of declaration is is, and the scope it lives in, among other things.



来源:https://stackoverflow.com/questions/45250879/why-are-symbols-for-classes-written-in-swift-difficult-to-read-in-lldb-is-it-po

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!