Skip next n breakpoints in lldb

In gdb, I could skip the next n breakpoints with "continue n" or skip the next n lines of "next n". What are the equivalents in lldb?

And if there were none, how can I create them myself in the lldb python extension? I tried something like this, but it did not work, lldb freezes when I type the command I added.

def cc(debugger, args, result, dict):
    target = debugger.GetSelectedTarget()
    process = target.GetProcess()
    process.Continue()
+5
source share
1 answer

The command process continueaccepts a parameter -ithat will ignore the following matches for the breakpoint that you stopped in the current thread. eg.

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 a breakpoint ignore counter directly with breakpoint modify -i count bpnum.

+4
source

All Articles