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

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

问题描述

当我点击关闭窗口返回时,我的 Qt5 应用程序崩溃了:

My Qt5 app crashes when I hit the close window returning:

MyApp(28741,0x7fff7aa73000) malloc: *** error for object 0x7fc40bc8e300: pointer being freed was not allocated
*** set a breakpoint in malloc_error_break to debug
The program has unexpectedly finished.

如何在 Qt Creator 4 (Mac OS) 中在 malloc_error_break 中设置断点以进行调试"?

How to "set a breakpoint in malloc_error_break to debug" in Qt Creator 4 (Mac OS)?

在 lldb/gdb 中通过终端来做应该更好,怎么做?

Should be better to do it via terminal in lldb/gdb, how?

参考:如何查找关闭时应用崩溃的原因?

推荐答案

在 Breakpoints 窗口中,右键单击->Add Breakpoint...Breakpoint type 更改为 函数名称并在Funcion:中输入malloc_error_break.另一种方法是打开调试器控制台 (Cmd+5) 并输入 b malloc_error_break.

In Breakpoints window, right click->Add Breakpoint... change Breakpoint type to Function name and type malloc_error_break in Funcion:. Another way is to open Debugger Console (Cmd+5) and type b malloc_error_break.

这篇关于如何在 Qt Creator 中“在 malloc_error_break 中设置断点进行调试"?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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