python - 跳过 lldb 中的下 n 个断点

标签 python xcode lldb

在 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/

相关文章:

xcode - 将 GSL 与 Xcode 7 结合使用 - 链接错误

ios - Xcode - 关闭调试

python - 在 lldb python 中打印结构数组

c++ - 启动调试 session 时 MacOS 上的 VSCode LLDB 错误

python - 如何在 python 中将字符串列表转换为整数?

python - 有效地获取 3D 阵列中堆叠图像的图像边界

c++ - Xcode,SFML 错误 dyld : Library not loaded

arrays - 在 swift 3 中使用 Json

python - 在多索引数据集中按名称引用 pandas 索引

python - 如何计算 pandas 系列列表中每个元素的出现次数?