如何“在 malloc_error_break 中设置断点进行调试" [英] How to "set a breakpoint in malloc_error_break to debug"

查看:55
本文介绍了如何“在 malloc_error_break 中设置断点进行调试"的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我得到了很多这样的控制台输出,而我的应用程序没有崩溃:

I'm getting lots of console outputs like this without my application crashing:

malloc:* 对象 0xc6a3970 的错误:未释放指针分配 * 在 malloc_error_break 设置断点调试

malloc: * error for object 0xc6a3970: pointer being freed was not allocated * set a breakpoint in malloc_error_break to debug

如何找出受影响的对象或变量?

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 中设置断点进行调试"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆