当前位置:网站首页>Lldb common commands

Lldb common commands

2022-06-24 04:20:00 Ma, Ma, Ma, Ma, Ma, Ma, Ma, Ma, Ma, Ma, Ma, Ma, Ma, Ma, Ma, Ma,

One 、 Generate executable files

Use gcc Of -g Option to compile

Two 、 Get into lldb And select the file to debug

lldb <filename> Yes filename debug

3、 ... and 、 To set breakpoints

break(b) set -l <line> -f <filename> Set breakpoint to filename File first line That's ok
break Options
-n <funcname> Specify the breakpoint as funcname function
-c <expr> Set breakpoint conditions <expr>, Such as i==1

breakpoint list Check the list of breakpoints
breakpoint delete 1 Delete the first set of breakpoints
breakpoint delete Delete all breakpoints

Four 、 debug

run(r) Start the target program
continue(c) Continue running the program until a breakpoint is encountered
next(n) One step operation , It doesn't go into the subfunction
step(s) One step operation , If you encounter a sub function, you will go in
finish step out

5、 ... and 、 View variable status

frame variable List all current variable values
print(p) < Variable name > View variable values
expr <expr> Set variable value , Such as a = 0

原网站

版权声明
本文为[Ma, Ma, Ma, Ma, Ma, Ma, Ma, Ma, Ma, Ma, Ma, Ma, Ma, Ma, Ma, Ma,]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/175/202206232315490802.html