问题描述
当我点击关闭窗口返回时,我的 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
.另一种方法是打开调试器控制台 (+) 并输入 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 (+) and type b malloc_error_break
.
这篇关于如何在 Qt Creator 中“在 malloc_error_break 中设置断点进行调试"?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!