在 gdb 中,我可以通过“continue n”跳过接下来的 n 个断点,或者通过“next n”跳过接下来的 n 行。 lldb 中的等价物是什么?
如果没有,我怎么能在 lldb python 扩展中自己创建它们?我尝试过类似的方法,但没有用,当我输入我添加的命令时,lldb 挂起。
def cc(debugger, args, result, dict):
target = debugger.GetSelectedTarget()
process = target.GetProcess()
process.Continue()
最佳答案
process continue
命令接受一个 -i
选项,该选项将忽略下一个 i 匹配您当前停止的断点当前线程。例如
Process 13559 stopped
* thread #1: tid = 0xb7da5, 0x0000000100000f21 a.out`main + 49 at a.c:7, stop reason = breakpoint 2.1
#0: 0x0000000100000f21 a.out`main + 49 at a.c:7
4 int i;
5 for (i = 0; i < 100; i++)
6 {
-> 7 printf ("%d\n", i);
8 }
9 }
(lldb) c -i 5
Process 13559 resuming
0
1
2
3
4
5
Process 13559 stopped
* thread #1: tid = 0xb7da5, 0x0000000100000f21 a.out`main + 49 at a.c:7, stop reason = breakpoint 2.1
#0: 0x0000000100000f21 a.out`main + 49 at a.c:7
4 int i;
5 for (i = 0; i < 100; i++)
6 {
-> 7 printf ("%d\n", i);
8 }
9 }
(lldb)
您也可以直接使用 breakpoint modify -i count bpnum
设置断点的忽略计数。
关于python - 跳过 lldb 中的下 n 个断点,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15307615/