加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

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

发布时间:2020-12-14 19:05:27 所属栏目:百科 来源:网络整理
导读:编辑:现在看来,它不仅限于帧信息,但事实上,断点命令添加命令无效.只有在(lldb)命令提示符下手动输入时,它们才有效 我通过XCode控制台在LLDB中设置了一些断点,以检查一个类及其在代码中的使用方式. (lldb) breakpoint set --func-regex "DVLayer" 断点7:73个
编辑:现在看来,它不仅限于帧信息,但事实上,断点命令添加命令无效.只有在(lldb)命令提示符下手动输入时,它们才有效

我通过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’继续’继续目标.

另请注意,此故障仅在断点命令添加语句中失败

如果我只是在(lldb)命令提示符处停止在LLDB中的断点处,我可以键入帧信息并且它按预期工作,但是,如上所述,添加帧信息作为断点命令完全失败并带有上面的输出.

解决方法

以下解决方法适用于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

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读