How do you watch a variable in xcode 4?
How do you watch a variable in xcode 4? I'm not sure how 开发者_如何学运维to do this.
Right click in the local variables window to see the "Watch Expression" menu command. Type the variable name and the variable will be added.
"Watch VariableName" is available in debug area. Just right click on a var and select "Watch var".
There is 2 ways to watch a variable and break at certain condition.
- Edit breakpoints
Control-click a breakpoint indicator to display a command menu and choose Edit Breakpoint to open the breakpoint editor and set conditions, add actions, and so forth, as mentioned in Breakpoints.
Use LLDB command line. For example, below command will watch the value of 'I', and break when I==3.
(lldb) watch set var i Watchpoint created: Watchpoint 1: addr = 0x100001018 size = 4 state = enabled type = w declare @ '/Volumes/data/lldb/svn/ToT/test/functionalities/watchpoint/watchpoint_commands/condition/main.cpp:12' (lldb) watch modify -c 'i==3' (lldb) watch list
This is where you can type LLDB command in Xcode.
精彩评论