LLDB:通过控制台为malloc_error_break设置断点 [英] LLDB: Setting a breakpoint for malloc_error_break through the console

查看:83
本文介绍了LLDB:通过控制台为malloc_error_break设置断点的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在代码中遇到了一些与malloc相关的问题:

I'm running into some malloc-related issues in my code:

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

我已经尝试过类似的事情:

I've tried things like:

(lldb) breakpoint set malloc_error_break
error: invalid combination of options for the given command

如何使用终端设置此断点?我在网上搜索过,仅发现涉及Xcode的结果.

How do I set this breakpoint using the terminal? I've searched online and only found results involving Xcode.

推荐答案

如果您熟悉gdb,则此小技巧可能会有所帮助:

If you are familiar with gdb, then this little cheat-sheet might help:

http://lldb.llvm.org/lldb-gdb.html

也:

(lldb) help break set

将为您提供有关在lldb中设置断点的许多信息.

will give you lots of information about setting breakpoints in lldb.

在这种情况下:

(lldb) br set --name malloc_error_break
(lldb) br set -n malloc_error_break

或:

(lldb) b malloc_error_break

第一个示例使用breakpoint set,这是一个"true"的lldb命令-它使用标志选项&值来区分您要尝试做的事情. b是一个合成命令,试图粗略地重新创建gdb断点语法.

The first examples use breakpoint set which is a "true" lldb command - it uses flag options & values to distinguish the kinds of things you are trying to do. bis a synthetic command that attempts to roughly recreate the gdb breakpoint syntax.

这篇关于LLDB:通过控制台为malloc_error_break设置断点的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆