Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Xcode LLDB watchpoints

Tags:

Is there any way to watch a variable in Xcode using LLDB ? Or is this only possible with GDB ? I'm trying to use the command watchpoint set variable but I get the message:

invalid command 'watchpoint set'

like image 486
the Reverend Avatar asked Jun 26 '12 00:06

the Reverend


People also ask

What does LLDB mean in Xcode?

What is LLDB? A low-level debugger (LLDB) is the default debugger used in Xcode and is part of the LLVM project. LLDB replaced GDB in XCode 5 and has several advantages, such as performance and scriptability.

Does Xcode use LLDB?

Xcode uses the LLDB as the default debugging tool. The full form of LLDB is Low-level debugger. Breakpoints help a developer to stop the execution of the program at any point. Stopping the execution of the program at any point helps to know the current state of that program and its properties.

How do I set a breakpoint in LLDB?

In lldb you can set breakpoints by typing either break or b followed by information on where you want the program to pause. After the b command, you can put either: a function name (e.g., b my_subroutine ) a line number (e.g., b 12 )

What is LLDB in iOS?

LLDB is the default debugger in Xcode and supports debugging Objective-C on iOS devices and the iOS simulator.


1 Answers

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.

like image 158
Jason Molenda Avatar answered Sep 20 '22 17:09

Jason Molenda