c++ - LLDB:通过控制台为malloc_error_break设置断点

标签 c++ lldb

我在我的代码中遇到了一些与 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/

相关文章:

lldb - Xcode 10,LLDB : Couldn't IRGen expression

c++ - 如何使用 lldb 在 manjaro 中调试 lz4 文件格式的 coredump?

swift - lldb 如何处理特殊用途的 _swift_runtime_on_report 函数?

c++ - const 非引用参数

c++ - 模棱两可的错误 : C++11 use variadic template multiple inheritance

c++ - 数据库 : Unable to resolve breakpoint in Hello World example

c++ - 我想通过lldb打印张量值

C++对象映射本地拷贝

c++ - 创建一个依赖于模板类型的值常量

c# - 在 .NET 的 Main() 方法之前执行代码