我在我的代码中遇到了一些与 malloc 相关的问题:
malloc: *** error for object 0x103401e28: incorrect checksum for freed object - object was probably modified after being freed.
*** set a breakpoint in malloc_error_break to debug
我试过这样的事情:
(lldb) breakpoint set malloc_error_break
error: invalid combination of options for the given command
如何使用终端设置此断点?我在网上搜索过,只找到了涉及 Xcode 的结果。
最佳答案
如果您熟悉 gdb,那么这个小备忘单可能会有所帮助:
http://lldb.llvm.org/lldb-gdb.html
还有:
(lldb) help break set
将为您提供有关在 lldb 中设置断点的大量信息。
在这种情况下:
(lldb) br set --name malloc_error_break
(lldb) br set -n malloc_error_break
或:
(lldb) b malloc_error_break
第一个示例使用 breakpoint set
,这是一个“真正的”lldb 命令 - 它使用标志选项和值来区分您尝试做的事情的种类。 b
是一个合成命令,它试图粗略地重新创建 gdb 断点语法。
关于c++ - LLDB:通过控制台为malloc_error_break设置断点,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28849961/