LLDB命令结构
1 | <command> [<subcommand> [<subcommand>...]] <action> [-options [option-value]] [argument [argument...]] |
to set a breakpoint in file test.c
at line 12 you enter:
1 | (lldb) breakpoint set --file test.c --line 12 |
here is a partial listing of the command options for the breakpoint set
command, listing the canonical form in parentheses:
1 | breakpoint set |
To set the same file and line breakpoint in LLDB, enter:
(lldb) breakpoint set --file foo.c --line 12
To set a breakpoint on a function named foo
in LLDB, enter:
(lldb) breakpoint set --name foo
Setting breakpoints by name is even more powerful in LLDB than in GDB because you can specify that you want to set a breakpoint at a function by method name. To set a breakpoint on all C++ methods named foo
, enter:
(lldb) breakpoint set --method foo
To set a breakpoint on Objective-C selectors named alignLeftEdges:
, enter:
(lldb) breakpoint set --selector alignLeftEdges:
You can limit any breakpoints to a specific executable image by using the --shlib
expression.
(lldb) breakpoint set --shlib foo.dylib --name foo