注:breakpoint 有很多用法,例如 br li 将会显示工程中加入的所有断点,br del 删除断点, br set 设置断点
(br set -f dashi.m -l 20, 就是在dashi.m 这个文件中的20行设置了一个断点),br command add 可以添加一些额外指令,比如打log,修改值,跳过这个断点...
(lldb)thread step-out
注:thread step-out 属于流程控制,上面的c也属于流程控制,还有n单步调试,s进入方法,fi(thread step-out的简写)跳出方法
(lldb) po $rax
<DVTGradientImageButton: 0x60800034b630>
oh!这个就是button实例,来吧,修改它。
(lldb) e DVTGradientImageButton* $btn = (id)0x60800034b630
(lldb) po $btn
如果你想知道DVTGradientImageButton里有哪些方法怎么办呢,对,仍然使用image lookup。
(lldb) image lookup -rn DVTGradientImageButton 22 matches found in /Applications/Xcode.app/Contents/SharedFrameworks/DVTKit.framework/Versions/A/DVTKit: Address: DVTKit[0x0000000000018a7f] (DVTKit.__TEXT.__text + 93551) Summary: DVTKit`-[DVTGradientImageButtonCell initWithGradientStyle:borderSides:] Address: DVTKit[0x0000000000018add] (DVTKit.__TEXT.__text + 93645) Summary: DVTKit`-[DVTGradientImageButtonCell initTextCell:] Address: DVTKit[0x0000000000018b2d] (DVTKit.__TEXT.__text + 93725) Summary: DVTKit`-[DVTGradientImageButtonCell dvt_commonInitWithGradientStyle:borderSides:] Address: DVTKit[0x0000000000018bb4] (DVTKit.__TEXT.__text + 93860) Summary: DVTKit`-[DVTGradientImageButtonCell _setGradientStyle:] Address: DVTKit[0x0000000000018c66] (DVTKit.__TEXT.__text + 94038) Summary: DVTKit`-[DVTGradientImageButtonCell setBorderSides:] Address: DVTKit[0x0000000000018c76] (DVTKit.__TEXT.__text + 94054) Summary: DVTKit`-[DVTGradientImageButtonCell setTitle:] Address: DVTKit[0x0000000000019ea5] (DVTKit.__TEXT.__text + 98709) Summary: DVTKit`-[DVTGradientImageButtonCell setGradientStyle:] Address: DVTKit[0x000000000001b4c6] (DVTKit.__TEXT.__text + 104374) Summary: DVTKit`-[DVTGradientImageButton setBorderSides:] Address: DVTKit[0x000000000001b512] (DVTKit.__TEXT.__text + 104450) Summary: DVTKit`-[DVTGradientImageButton setGradientStyle:] Address: DVTKit[0x000000000001b904] (DVTKit.__TEXT.__text + 105460) Summary: DVTKit`+[DVTGradientImageButton cellClass] Address: DVTKit[0x000000000002896b] (DVTKit.__TEXT.__text + 158811) Summary: DVTKit`-[DVTGradientImageButtonCell setUsedAsRadioButton:] Address: DVTKit[0x0000000000030939] (DVTKit.__TEXT.__text + 191529) Summary: DVTKit`-[DVTGradientImageButtonCell drawWithFrame:inView:] Address: DVTKit[0x00000000000314e4] (DVTKit.__TEXT.__text + 194516) Summary: DVTKit`-[DVTGradientImageButtonCell borderSides] Address: DVTKit[0x00000000000314f4] (DVTKit.__TEXT.__text + 194532)
Summary: DVTKit`-[DVTGradientImageButtonCell gradientStyle] Address: DVTKit[0x0000000000050b9c] (DVTKit.__TEXT.__text + 323212) Summary: DVTKit`-[DVTGradientImageButtonCell initWithCoder:] Address: DVTKit[0x00000000000b00fb] (DVTKit.__TEXT.__text + 713707) Summary: DVTKit`-[DVTGradientImageButtonCell initImageCell:] Address: DVTKit[0x00000000001cd9c4] (DVTKit.__TEXT.__text + 1883316) Summary: DVTKit`-[DVTGradientImageButtonCell(Accessibility) accessibilityAttributeValue:] Address: DVTKit[0x00000000002897f3] (DVTKit.__TEXT.__text + 2652899) Summary: DVTKit`-[DVTGradientImageButton gradientStyle] Address: DVTKit[0x0000000000289837] (DVTKit.__TEXT.__text + 2652967) Summary: DVTKit`-[DVTGradientImageButton borderSides] Address: DVTKit[0x000000000028987b] (DVTKit.__TEXT.__text + 2653035) Summary: DVTKit`-[DVTGradientImageButtonCell _shouldUseColorPunchOutStyle] Address: DVTKit[0x000000000028991f] (DVTKit.__TEXT.__text + 2653199) Summary: DVTKit`-[DVTGradientImageButtonCell _isTabStyleCell] Address: DVTKit[0x0000000000289988] (DVTKit.__TEXT.__text + 2653304) Summary: DVTKit`-[DVTGradientImageButtonCell usedAsRadioButton] (lldb)
(lldb) po [$btn setBorderSides:10]
(lldb) po [$btn setGradientStyle:10]
(lldb) c
Process 24887 resuming
网易云新用户大礼包:https://www.163yun.com/gift
本文来自网易实践者社区,经作者范飞授权发布。