繁体   English   中英

lldb断点命令在XCode 8中不起作用

[英]lldb breakpoint commands not working in XCode 8

编辑:现在看来,它不仅限于frame info但实际上, breakpoint command add命令中没有一个起作用。 只有在(lldb)命令提示符下手动输入时,它们才起作用

我通过XCode控制台在LLDB中设置了一些断点,以检查一个类及其在代码中的用法。

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

断点7:73个位置。

(lldb) breakpoint command add 7

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

 frame info

 continue

 DONE

在XCode 4之前的所有XCode早期版本中,此方法均能正常工作。但是,现在,我得到的只是控制台中的这些语句,没有任何框架信息。 我已经在5个不同的类上尝试了breakpoint命令,但它们都不起作用...始终是此输出。

#2命令“继续”继续执行目标。

#2命令“继续”继续执行目标。

#2命令“继续”继续执行目标。

#2命令“继续”继续执行目标。

#2命令“继续”继续执行目标。

#2命令“继续”继续执行目标。

#2命令“继续”继续执行目标。

#2命令“继续”继续执行目标。

#2命令“继续”继续执行目标。

另请注意, 此操作仅在breakpoint command add语句内起作用

如果我只是在(lldb)命令提示符处停在LLDB中的断点处,则可以键入frame info ,并且可以按预期工作,但是,如上所述,将frame info作为断点命令添加到上面的输出完全失败。

以下变通办法在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:]

编辑:更多信息:我无法在Xcode 8中获得外部python脚本。

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

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM