7
A
回答
18
易于与breakpoint command add
命令。请输入help breakpoint command add
以获取详细信息,但这里是一个示例。
int main()
{
int i = 0;
while (i < 30)
{
i++; // break here
}
}
对此运行lldb。首先,把一个断点在源代码行以“破”的地方在它(好的速记像这样的例子,但它基本上有你的源代码的grep过来的,所以不适合大型项目有用)
(lldb) br s -p break
Breakpoint 1: where = a.out`main + 31 at a.c:6, address = 0x0000000100000f5f
添加断点
(lldb) br mod -c 'i % 5 == 0' 1
具有断点打印的i
和回溯的电流值,当它击中:状态所以断点时i
是5的倍数仅停止
(lldb) br com add 1
Enter your debugger command(s). Type 'DONE' to end.
> p i
> bt
> DONE
然后使用它:
Process 78674 stopped and was programmatically restarted.
Process 78674 stopped and was programmatically restarted.
Process 78674 stopped and was programmatically restarted.
Process 78674 stopped and was programmatically restarted.
Process 78674 stopped
* thread #1: tid = 0x1c03, 0x0000000100000f5f a.out`main + 31 at a.c:6, stop reason = breakpoint 1.1
#0: 0x0000000100000f5f a.out`main + 31 at a.c:6
3 int i = 0;
4 while (i < 30)
5 {
-> 6 i++; // break here
7 }
8 }
(int) $25 = 20
* thread #1: tid = 0x1c03, 0x0000000100000f5f a.out`main + 31 at a.c:6, stop reason = breakpoint 1.1
#0: 0x0000000100000f5f a.out`main + 31 at a.c:6
#1: 0x00007fff8c2a17e1 libdyld.dylib`start + 1
相关问题
- 1. lldb断点设置命令失败
- 2. lldb断点命令在XCode 8中不起作用
- 3. 如何编辑LLDB中的命令行?
- 4. 如何通过命令行
- 5. BASH - 添加新命令+通过该命令运行python?
- 6. 如何通过命令行为ghostscript添加水印?
- 7. 通过python接口在gdb的断点处执行命令
- 8. 在lldb中跳过下n个断点
- 9. 如何通过叠加硒ide来添加自定义命令?
- 10. 通过命令行
- 11. 通过命令行
- 12. 通过命令行
- 13. 如何将命令操作添加到OS X上的'打开...'
- 14. 节点JS - 通过命令行
- 15. 如何通过命令行界面运行这个curl命令
- 16. 通过传递命令行参数自动保存操作
- 17. lldb未解决的断点通过C++ api
- 18. 如何通过命令行运行以下添加Java命令行参数在Eclipse调试
- 19. 如何通过PHP执行SSH命令
- 20. 如何通过python运行adb命令?
- 21. 如何更新通过命令行
- 22. 如何通过.NET执行Minitab命令?
- 23. 如何通过vbs执行命令
- 24. 如何通过命令行构建SSISDeploymentManifest
- 25. 如何通过Python执行shell命令
- 26. 如何通过命令行配置Eclipse?
- 27. 如何通过robotframework执行ssh命令
- 28. 通过命令行通过WebDeploy部署失败,由于无效操作
- 29. 如何在gdb断点的命令中执行和执行更多命令
- 30. 如何从命令行添加gdi32.lib
非常感谢老兄!我认为它一定是在“断点设置”的某个地方,而我完全是在错误地咆哮。 – PHD 2013-05-02 19:47:38