开发者

How can i find out the symbol name the compiler generated for my code?

I know this is pr开发者_如何学Goetty much a stupid question. I know almost nothing about how compiler really works.

But recently I want find what symbol name does the compiler generate for my ivar, my methods. Where and how can I know the answer? (I have only used some IDEs. So if the solution is better to be simple . And it would be great help if the instructions you provide is really explicit)

(By the way,is there any reference that i can learn about the things like this?)

PS.I'm IOS developer.And if gcc and LLVM works different answer on this question , I would like to know both.


You can use nm to dump the content of a binary object. Then, each compiler has its own way of mangling. I suggest you have a look at Name mangling for objective C in wikipedia, it will help you understand how mangling works.


Surely GCC and Clang must have compatible name-mangling schemes, since they can use each other's code.


If you are using XCode 3 select a source file and then pick "Show Assembly Code" from the Build menu.

Apparently XCode 4 users do not need assembly code :-(

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜