问题描述
我得到了很多这样的控制台输出,而我的应用程序没有崩溃:
I'm getting lots of console outputs like this without my application crashing:
malloc:* 对象 0xc6a3970 的错误:未释放指针分配 * 在 malloc_error_break 设置断点调试
如何找出受影响的对象或变量?
How can I find out which object or variable is affected?
我尝试设置一个像这样的符号断点,但它永远不会停止:
I tried setting a symbolic breakpoint like this but it never halts:
推荐答案
通过打开 Breakpoint Navigator(View->Navigators->Show Breakpoint Navigator 或 ⌘8),在 malloc_error_break() 上设置断点,单击加号按钮在左下角,然后选择添加符号断点".在出现的弹出窗口中,在符号字段中输入 malloc_error_break
,然后单击完成.
Set a breakpoint on malloc_error_break() by opening the Breakpoint Navigator (View->Navigators->Show Breakpoint Navigator or ⌘8), clicking the plus button in the lower left corner, and selecting "Add Symbolic Breakpoint". In the popup that comes up, enter malloc_error_break
in the Symbol field, then click Done.
openfrog 添加了一个屏幕截图并表示他已经尝试了这些步骤但没有成功我发布了我的答案.有了那个编辑,我不知道该说什么.我还没有看到我自己失败了,事实上我总是在 malloc_error_break 集上设置一个断点.
openfrog added a screenshot and indicated that he's already tried these steps without success after I posted my answer. With that edit, I'm not sure what to say. I haven't seen that fail to work myself, and indeed I always keep a breakpoint on malloc_error_break set.
这篇关于如何“在 malloc_error_break 中设置断点进行调试"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!