How to skip a couple lines of code with lldb?

Is there a way to skip lines of code when debugging with lldb without having to recompile?

+5
source share
1 answer

UPDATE

In addition to the original answer below, jump / j aliases can be used to skip multiple lines or jump to a specific line number:

To skip two lines forward:

 (lldb) jump +2 

To go to line 102:

 (lldb) jump 102 

See help jump more details.

ORIGINAL

This can be achieved using the thread jump command by specifying the --by / -b flag. Example:

 (lldb) thread jump --by 2 (lldb) th j -b 2 

Alternatively, instead of a relative move, the absolute line number may be specific with --line / -l .

 (lldb) thread jump --line 102 (lldb) th j -l 102 

Please note that both of them move the program counter, and this can lead to a program crash and crashes.

+11
source

All Articles