在Xcode中,可以使用所谓的guard malloc标志来简化调试malloc和指针的工作。

我不知道在调试时如何在Qt Creator上使用该标志。

在手册页中,他们给出了将其与gdb一起使用的示例:

% cc -g -o gmalloctest gmalloctest.c
% gdb gmalloctest
Reading symbols for shared libraries .. done
(gdb) set env DYLD_INSERT_LIBRARIES /usr/lib/libgmalloc.dylib
(gdb) r


如何在调试时告诉Qt Creator“设置环境”?

最佳答案

您可以在Creator的项目“运行设置”面板中设置环境变量:http://doc.qt.nokia.com/qtcreator-2.4/creator-run-settings.html

展开“运行环境”以添加/编辑变量。它们在您运行/调试项目时设置。

关于c++ - 使用Guard Malloc(Mac OS)在Qt Creator中进行调试,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/10370913/

10-11 14:35