Xcode LLDB watchpoints

£可爱£侵袭症+ 提交于 2019-11-30 06:39:17

Watchpoints are supported for iOS and Mac OS X debugging as of Xcode 4.5. To set a breakpoint on a variable named foo, do

(lldb) watchpoint set variable foo

you can always use the shortest unambiguous name for commands in the lldb console so

(lldb) w s v foo

would also work here.

In Xcode, in the locals window you can right-click/control-click on variables and you'll have an option to set a watchpoint on it.

The current arm and x86 cpus only support 4 watchpoints being active at the same time.

Try using

frame variable -w

instead. The 'watchpoint set' command is in lldb's development branch, and will likely make it in to a future version of Xcode.

For example:

frame variable -w write myvar

EDIT: The watch set variable syntax mentioned in the original post is now supported in lldb in XCode 4.4 and greater.

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!