现在的位置: 首页 > 综合 > 正文

在 LLDB 中为 Objective-C 设置断点

2012年08月13日 ⁄ 综合 ⁄ 共 640字 ⁄ 字号 评论关闭

To set a breakpoint Objective C selectors named alignLeftEdges: you can enter either of:

(lldb) breakpoint set --selector alignLeftEdges: 
(lldb) breakpoint set -S alignLeftEdges:

You can limit any breakpoints to a specific executable image by using the "--shlib <path>" ("-s <path>" for short):

(lldb) breakpoint set --shlib foo.dylib --name foo 
(lldb) breakpoint set -s foo.dylib -n foo

Suggestions on more interesting primitives of this sort are also very welcome.

Just like gdb, the lldb command interpreter does a shortest unique string match on command names, so the following two commands will both execute the same command:

(lldb) breakpoint set -n "-[SKTGraphicView alignLeftEdges:]" 
(lldb) br s -n "-[SKTGraphicView alignLeftEdges:]"

抱歉!评论已关闭.