Search code examples
c++xcodedebugginglldbwatchpoint

XCode 4.5 watchpoints not working


I'm trying to debug C++ code in Xcode 4.5 on iOS, running the app on a connected iPad 2.

I set a regular breakpoint on my code, and when I hit it, I look at my Local variables, click on a variable and select "Watch xxxxx".

The lldb console shows:

error: failed to create watchpoint for m_step

Same result if I try to set it by hand in the console, with the command:

w s v xxxxx

I get:

error: Wathpoint creation failed (addr=0x..... size=4) error: sending gdb watchpoint packet failed

I'm running with a debug configuration, using LLDB. Any clue whether there is something else I should check?

EDIT: here are my settings:

settings settings settings


Solution

  • What iOS is your iPad 2 running? Watchpoint support requires a debug server included in iOS 6, not earlier versions. It sounds like the debug server running on your device does not have watchpoint support. The device-side debug server is fixed with the iOS build, it doesn't get updated by Xcode. Watchpoint support in Xcode 4.5 involved changes to both the device-side debug server (in iOS 6) and changes to lldb in Xcode on the Mac. Both sides are required for this feature.