Tag: malloc history

malloc_history无法检查进程xxxxxx,因为该进程在iOS中不存在

我将下面的环境variables添加到我的项目,并将其值设置为YES。 NSDebugEnabled NSZombieEnabled MallocStackLogging MallocStackLoggingNoCompact 我遵循http://www.cocoadev.com/index.pl?DebuggingAutorelease中的程序 我能够根据生成的日志find问题。 我的疑问是,当我试图find堆栈跟踪find对象分配的位置,我得到了下面的信息: malloc_history无法检查进程6963,因为进程不存在。 我在这里错过了什么? 以下是创build的日志: 更新: 我发现下面的链接是一个很好的信息来源: 奇怪的GDB错误无法跟踪 我还没有testing这个。

了解一个malloc_history转储

如果您曾经问​​过如何在objective-c中debugging释放/分配问题,您将遇到以下环境设置,可以帮助跟踪问题: NSZombieEnabled – 在发布后保持不变,所以你可以得到指针等。 MallocStackLogging – 保留对象历史logging以备日后参考 NSDebugEnabled 在“可执行文件”(在组树中)信息的“参数”选项卡的“环境”部分中,将所有这些设置为YES 。 所以,我得到这个控制台输出 MyApp [ 4413 :40b] – [CALayer retainCount]:发送到释放实例0x4dbb170的消息 然后打开terminal,而debugging器已转发中断并input: malloc_history 4413 0x4dbb170 然后,我得到一个大文本转储,据我所知,重要的是这样的: 1 ALLOC 0x4dbb160-0x4dbb171 [size=18]: thread_a0375540 |start | main | UIApplicationMain | GSEventRun | GSEventRunModal | CFRunLoopRunInMode | CFRunLoopRunSpecific | __CFRunLoopRun | __CFRunLoopDoTimer | __CFRUNLOOP_IS_CALLING_OUT_TO_A_TIMER_CALLBACK_FUNCTION__ | __NSFireDelayedPerform | -[todoListViewController drillDocumentMenu:] | -[documentListViewController drillIntoDocumentWithToDoRecord:] […]