How to skip a couple of lines code with lldb?

我只是一个虾纸丫 提交于 2020-08-01 05:54:40

问题


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


回答1:


UPDATE

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

To skip two lines ahead:

(lldb) jump +2

To skip to line 102:

(lldb) jump 102

See help jump for more info.

ORIGINAL

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

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

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

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

Note that these both move the program counter, and that could put the program into a broken state and lead to crashes.



来源:https://stackoverflow.com/questions/30472950/how-to-skip-a-couple-of-lines-code-with-lldb

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!