大佬教程收集整理的这篇文章主要介绍了用于跟踪iOS设备上的Objective-C调用的GDB脚本 – 问题,大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。
b objc_msgSend c commands silent if (*$r0 == 0) continue end set $id = (class_t *)$r0 set $sel = $r1 print *$id if($id->data_NEVER_USE != 0) set $data = (class_ro_t *) ($id->data_NEVER_USE) if (($data->flags & 0x80000000) && ($data->name)) set $classname = $data->name printf "[%s ",$classname else continue end end if ($sel != 0) printf "%s",$sel else printf "null" end printf "]\n" continue end
我很感激任何帮助.谢谢.
gdb (gdb) attach --waitfor 'SomeApp' **this is where you manually start SomeApp on your device** call (void)instrumentObjcMessageSends(YES)
“instrumentObjcMessageSends”启用/禁用运行时内的消息记录.这是一些more information on this method.
另一个选项,仍然在你的iDevice上使用GDB,就是写一个这样的小命令:
FooPad:~ root# gdb (gdb) attach SBSettings Attaching to process 440. Reading symbols for shared libraries . done Reading symbols for shared libraries ............................. done 0x35686004 in mach_msg_trap () (gdb) break objc_msgSend Breakpoint 1 at 0x3323ef72 (gdb) commands Type commands for when breakpoint 1 is hit,one per line. End with a line saying just "end". >printf "-[%s %s]\n",(char *)class_getName(*(long *)$r0,$r1),$r1 >c >end (gdb) c Continuing. // a ton of information will follow
只要按下“c”(右上方的行显示“继续.”),您的屏幕将填充函数名称和参数.
最后按照these instructions在你的iDevice上获得一个可用的GDB.对于后代,我会在这里发布简短说明:
以上是大佬教程为你收集整理的用于跟踪iOS设备上的Objective-C调用的GDB脚本 – 问题全部内容,希望文章能够帮你解决用于跟踪iOS设备上的Objective-C调用的GDB脚本 – 问题所遇到的程序开发问题。
如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。
本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。