2016-11-14 38 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窗口中打開,只是爲了讓它保持在我的腦海。現在這個項目真的很忙,但我可能會在本週末嘗試一下。感謝您的登錄。 –