简体   繁体   English

LLDB相当于GDB的“info malloc-history <address> “命令?

[英]LLDB equivalent to GDB's “info malloc-history <address>” command?

我试图在iOS中解决“发送到解除分配的实例的消息”错误。

See the LLDB-GDB command map ( http://lldb.llvm.org/lldb-gdb.html ) - you have to import a script, and the command is named malloc_info now. 请参阅LLDB-GDB命令图( http://lldb.llvm.org/lldb-gdb.html ) - 您必须导入脚本,该命令现在名为malloc_info。 Obviously, malloc stack logging still needs to be turned on in the scheme options. 显然,仍然需要在方案选项中打开malloc堆栈日志记录。

(lldb) script import lldb.macosx.heap
(lldb) malloc_info --stack-history 0x10010d680

Unfortunately, it doesn't show dealloc's - didn't GDBs malloc-history show that as well? 不幸的是,它没有显示dealloc的 - 没有GDBs malloc-history显示那个?

Use instruments, you'll get the exact line - 使用乐器,你会得到确切的线 -

(In XCode) Run it through "Product" -> "Profile". (在XCode中) 通过“Product” - >“Profile”运行它。

This will start Instruments, there you should choose "Zombies" and reproduce the bug event. 这将启动Instruments,你应该选择“Zombies”并重现bug事件。

You'l get a pop-up once a zombie is called, press the chevron to see the exact line . 一旦调出一个僵尸,你会弹出一个弹出窗口, 按下V形符号查看确切的线条

Problem is usually a bad __bridge (optional bridges __brige_retained / __bridge_transfer / __bridge ) 问题通常是坏__bridge (可选桥__brige_retained / __bridge_transfer / __bridge

You used to be able to use the malloc_history command-line tool from a shell and give it the process ID and address of interest. 您以前可以使用shell中的malloc_history命令行工具,并为其提供感兴趣的进程ID和地址。 It appears this command is no longer installed by the latest Xcode's command line tools. 最新的Xcode命令行工具似乎不再安装此命令。 :-( :-(

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM