Lldb breakpoint commands not working in Xcode 8

EDIT: now it seems that it is not limited to frame info , but it actually works NONE from breakpoint command add commands. They will only work if entered manually at the command prompt (lldb)

I set some breakpoints in LLDB through the Xcode console to learn the class and how it is used in the code.

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

Breakpoint 7: 73.

 (lldb) breakpoint command add 7 

Enter the debug command (s). Enter "DONE" to complete.

  frame info continue DONE 

This works fine in all previous versions of Xcode, returning to Xcode 4. Now, however, all I get is the console instructions and frame information. I tried breakpoint commands on 5 different classes, and it didn't work on any of them ... always this conclusion.

Team # 2 “continue” continued the goal.

Team # 2 “continue” continued the goal.

Team # 2 “continue” continued the goal.

Team # 2 “continue” continued the goal.

Team # 2 “continue” continued the goal.

Team # 2 “continue” continued the goal.

Team # 2 “continue” continued the goal.

Team # 2 “continue” continued the goal.

Team # 2 “continue” continued the goal.

Also note that THIS ONLY SHOULD NOT WORK INSIDE A breakpoint command add

If I just stopped at a breakpoint in LLDB on the command line (lldb), I can type frame info and it works as expected, however, as mentioned above, adding frame info as a break command does not fully output the above.

+5
source share
1 answer

In Xcode 8.0, the following workaround worked for me:

 (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:] 

EDIT: More info: I can't get external python scripts running in Xcode 8.

EDIT: link to python LLDB commands: https://lldb.llvm.org/python-reference.html

0
source

Source: https://habr.com/ru/post/1259734/


All Articles