繁体   English   中英

奇怪的GDB错误无法追踪

[英]strange GDB error unable to trace

我在gdb中得到这个奇怪的错误,我无法跟踪确切的代码行来追踪错误。 有人知道这种类型的错误吗? 这是我在gdb中得到的

*** -[CALayer sublayers]: message sent to deallocated instance 0x911c2a0
(gdb) po 0x911c2a0
Program received signal SIGTRAP, Trace/breakpoint trap.
0x020993a7 in ___forwarding___ ()
The program being debugged was signaled while in a function called from GDB.
GDB has restored the context to what it was before the call.
To change this behavior use "set unwindonsignal off"
Evaluation of the expression containing the function (_NSPrintForDebugger) will be   abandoned.
(gdb) info symbol 0x911c2a0
No symbol matches 0x911c2a0.
(gdb) 

您可以尝试以下操作以查看错误CALayer的分配位置:

(gdb) info malloc 0x911c2a0

我不知道gdb是否与僵尸对象配合得很好,但很明显,它似乎有一些局限性。

显然,你有一个内存管理错误。

而且你根本没有跟踪确切的行。 要获取堆栈跟踪,请键入bt ,或者只需查看Debugger窗口(Run→Debugger)。

po表示“打印Objective-C对象”。由于该特定实例已被解除分配,因此po -ing将导致进一步的错误。)

尝试使用设置为YES可执行环境的NSZombieEnabled进行调试:

要在您的应用程序中激活NSZombieEnabled工具:

选择“项目”>“编辑活动可执行文件”以打开可执行信息窗口。 单击“参数”。 单击“要在环境中设置的变量”部分中的添加(+)按钮。 在“名称”列中输入NSZombieEnabled,在“值”列中输入“是”。 确保选中NSZombieEnabled条目的复选标记。

您还可能需要添加几个断点来帮助您调试它们:

fb -[_NSZombie init]
fb -[_NSZombie retainCount]
fb -[_NSZombie retain]
fb -[_NSZombie release]
fb -[_NSZombie autorelease]
fb -[_NSZombie methodSignatureForSelector:]
fb -[_NSZombie respondsToSelector:]
fb -[_NSZombie forwardInvocation:]
fb -[_NSZombie class]
fb -[_NSZombie dealloc]

我已经解决了这个问题。 问题是由于视图控制器。 视图控制器已发布,然后调用该方法。 但奇怪的gdb没有显示任何关于viewController的内容......没有任何关于NSZombie的帮助。

暂无
暂无

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

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