2016-11-14 40 views
5

编辑:它现在看起来并不局限于frame info,但实际上,breakpoint command add命令中的NONE都不起作用。如果在(LLDB)键入手动他们只会工作命令提示符lldb断点命令在XCode 8中不起作用

我通过在Xcode控制台设置LLDB一些断点,检查类以及它如何在代码中使用。

(lldb) breakpoint set --func-regex "DVLayer" 

断点7:73个位置。

(lldb) breakpoint command add 7 

输入您的调试器命令。输入'DONE'结束。

frame info 

continue 

DONE 

这XCode中要回了XCode 4.所有先前版本的工作正常但是现在,我得到的是在控制台这些语句,并没有帧信息。 我已经尝试了5个不同类的断点命令,它对任何一个都没有影响......总是这个输出。

命令#2'继续'继续目标。

命令#2'继续'继续目标。

命令#2'继续'继续目标。

命令#2'继续'继续目标。

命令#2'继续'继续目标。

命令#2'继续'继续目标。

命令#2'继续'继续目标。

命令#2'继续'继续目标。

命令#2'继续'继续目标。

还要注意的是这只是失败的工作里面breakpoint command add声明

如果我在LLDB断点简单地停在(LLDB)命令提示符下,我可以输入frame info和它的作品如预期,但是,如上所示,添加frame info作为断点命令完全失败,并显示以上输出。

回答

0

以下的解决方法在Xcode 8.0为我工作:

(lldb) breakpoint set --func-regex "setTitle" 
Breakpoint 2: 296 locations. 
(lldb) breakpoint command add --script-type python 2 
Enter your Python command(s). Type 'DONE' to end. 
def function (frame, bp_loc, internal_dict): 
    """frame: the lldb.SBFrame for the location at which you stopped 
     bp_loc: an lldb.SBBreakpointLocation for the breakpoint location information 
     internal_dict: an LLDB support object not to be used""" 
    print str(frame) 
    frame.GetThread().GetProcess().Continue() 
    DONE 
(lldb) 
frame #0: 0x00000001879ca4b8 UIKit`-[UIButton _setTitleShadowOffset:] 
frame #0: 0x00000001879ca4b8 UIKit`-[UIButton _setTitleShadowOffset:] 
frame #0: 0x00000001879ca4b8 UIKit`-[UIButton _setTitleShadowOffset:] 
frame #0: 0x000000018781ef68 UIKit`-[UIButton setTitleColor:forState:] 
frame #0: 0x000000018781efb4 UIKit`-[UIButtonContent setTitleColor:] 
frame #0: 0x000000018781ef68 UIKit`-[UIButton setTitleColor:forState:] 
frame #0: 0x000000018781efb4 UIKit`-[UIButtonContent setTitleColor:] 
frame #0: 0x000000018781ef68 UIKit`-[UIButton setTitleColor:forState:] 
frame #0: 0x000000018781efb4 UIKit`-[UIButtonContent setTitleColor:] 
frame #0: 0x000000018781edec UIKit`-[UIButton setTitle:forState:] 
frame #0: 0x000000018781ee6c UIKit`-[UIButtonContent setTitle:] 

编辑:更多的信息:我不能让外部Python脚本在Xcode去8

编辑:链接LLDB Python命令: https://lldb.llvm.org/python-reference.html

+0

对不起,我没有注意到你的答案越早。刚刚看到它。我会在本周给你一个镜头,如果它能解决问题,给你信用(标记为已回答)。感谢这个例子。 –

+0

你有机会测试吗? – mikep

+0

哈,对不起麦克,我还没有,但它在我的待办事项上。我从字面上将这个页面全天24小时在Chrome窗口中打开,只是为了让它保持在我的脑海。现在这个项目真的很忙,但我可能会在本周末尝试一下。感谢您的登录。 –