Reputation: 4053
I am trying to set a watchpoint while debugging my app on the device. I am unable to set it on either gdb or lldb.
On lldb, I don't see the watchpoint set
option in the debugger even though this page mentioned that it exists. When I try to run watchpoint set
, lldb tells me that the command is not valid.
On gdb, I do get to set the watchpoint (using watch var
), but when I try to continue execution I get this:
Can't set hardware watchpoints without the 'Z2' (write-watchpoint) packet.
I see no further output in the gdb window nor do I think I can interact with it. The app also remains hung at this point.
I am using Xcode 4.3.2 (4E2002) on OS X Lion. I tried setting the watchpoint on devices with iOS 5.1 and iOS 5.0.1 but encounter the same problem on both.
Upvotes: 5
Views: 2334
Reputation: 15425
Before Xcode 4.5, watchpoints were not supported for iOS development with either lldb or gdb.
With Xcode 4.5, they are supported for iOS and Mac OS X debugging with lldb.
In Xcode, in the locals window, you can right-click/control-click on a variable and there will be an option to set a watchpoint on it. From the debugger console, to add a watchpoint on a variable called foo, you can do
(lldb) watchpoint set variable foo
the shortest unambiguous command is always valid in lldb so this would do the same thing,
(lldb) w s v foo
The current x86 and arm cpus only support 4 watchpoints being set simultaneously.
Upvotes: 7
Reputation: 3436
I read this somewhere in the Apple Dev Forums : "The set command exists in the trunk version but not in the Xcode version yet."
I am also stuck with this problem where I want to keep a watch on a variable and see where its value changes...
Upvotes: 0