Does LLDB have convenience variables ($var)?

前端 未结 3 1837
暗喜
暗喜 2021-01-30 13:03

Does LLDB have convenience variables? If so, how do I use them? If not, is there anything similar that I can use?

Reference: http://software.intel.com/sites/products/doc

3条回答
  •  伪装坚强ぢ
    2021-01-30 13:34

    I struggled with this today. Here's what it looks like to deal with Objective-C variables in LLDB:

    expr UIApplication *$app = (UIApplication *)[UIApplication sharedApplication]
    expr UIWindow *$keyWindow = (UIWindow *)[$app keyWindow]
    

    etc. I've found LLDB works best if you don't nest any calls, and you explicitly give a return type on every call.

    Still I am getting a segmentation fault when I try to make initWithFrame: work on a UIView later on though. :/

提交回复
热议问题