In gdb I could skip next n breakpoints by "continue n", or skip next n lines by "next n". What's the equivalents in lldb?
And if there was none, how could I create them myself in lldb python extension? I tried something like this, but it didn't work, lldb hangs when I type the command I added.
def cc(debugger, args, result, dict):
target = debugger.GetSelectedTarget()
process = target.GetProcess()
process.Continue()
The process continue
command accepts a -i
option which will ignore the next i matches for the breakpoint you're currently stopped at on the current thread. e.g.
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)
You can also set the ignore-count of a breakpoint directly with breakpoint modify -i count bpnum
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With