在iPhone上记录objc_msgSend() [英] Logging objc_msgSend() on iPhone
问题描述
有一个记录机制的ObjC消息,但我不知道是否你将获得没有符号文件的方法名称。假设您的越狱手机将允许您在调试器(gdb)的控制下运行任何应用程序,您应该可以启动应用程序,在初始化期间提前设置断点,然后执行以下操作:
(gdb)call(void)instrumentObjcMessageSends(YES)
日志文件将被写入tmp文件夹中的文本文件。更多细节:
http://www.dribin.org/dave/blog/archives/2006/04/22/tracing_objc/
I recently ran into a problem for which there were no working solutions on Google. I'd like to log an applications's Objective-C messages to the console or to a file. I didn't write the application so I don't have the source code to recompile with logging included. I have a jailbroken iPhone so no restrictions on how to realize this. I even considered doing this through a MobileSubstrate extension (may I hook objc_msgSend for that application to do some logging?), but had not very much ideas. Can you please help me out with this?
There is a logging mechanism for ObjC messages, but I'm not sure whether you'll get method names without symbol files. Assuming that your jailbroken phone will allow you to run any app under control of the debugger (gdb), you should be able to start the app, set a breakpoint early during the initialization, then do this:
(gdb) call (void)instrumentObjcMessageSends(YES)
The log file will be written to a text file in the tmp folder. More details here:
http://www.dribin.org/dave/blog/archives/2006/04/22/tracing_objc/
这篇关于在iPhone上记录objc_msgSend()的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!