【发布时间】:2022-01-23 10:58:55
【问题描述】:
当我在 LLDB 中遇到断点时,我想执行多个自动执行程序的命令。
示例(这应该会改变程序以跳过 foo::bar 进行的第一次调用):
breakpoint set --method foo::bar --command s --command 'thread return'
当我尝试上面的例子时:
- 我确实遇到了断点
-
s被执行 - 但随后会打印以下内容:
error: Aborting reading of commands after command #1: 's' continued the target.和thread return未执行
【问题讨论】:
-
你读过GDB's manual on breakpoint commands吗?你可以给
step一个count argument。 -
感谢您的链接。我明白了:gdb 确实为这种设计选择提供了理由。它在 gdb 文档中,所以我没有阅读它。 “你可以给 step 一个计数参数” - 这对我的用例没有帮助 - 我想运行不同的命令(参见我的问题中的示例)