如何在Qt Creator中“设置malloc_error_break中的断点以调试”

How to “set a breakpoint in malloc_error_break to debug” in Qt Creator?

本文关键字:break error 断点 调试 malloc Qt Creator 设置      更新时间:2023-10-16

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

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中的断点以调试"?

应该通过终端在lldb/gdb做,怎么做?

参考:如何找到应用程序崩溃关闭的原因?

在断点窗口中,右键单击->添加断点…更改断点类型函数名函数:中的类型malloc_error_break。另一种方法是打开调试器控制台(Cmd+5)并输入b malloc_error_break

相关文章: