How to set conditional breakpoint in lldb, I mean, reliably?

I'm using lldb in terminal, thanks to apple's dropping support to gdb... And the thing is, I am no longer able to use conditional breakpoint reliably now... I'm using a command

breakpoint set -f somefile -l someline -c '(some condition)'

and then hit r to run my program. And then it says the process is running and then prompt back to

(lldb)

And more annoying thing is, my program is still running somehow, and lldb stopped respond to my command correctly. When I type

breakpoint list
, it respond
invalid command reakpoin
.

Do you guys know what happened? Is it lldb very buggy or did I do something wrong? How to set a conditional breakpoint reliably?

MacBook Air (13-inch, Mid 2012), OS X Mountain Lion (10.8.2)

Posted on Nov 3, 2013 10:45 PM

Reply
1 reply

Nov 4, 2013 11:54 AM in response to Janeson89

The only thing I see that you could have done wrong was make a mistake entering the condition. If there's a problem in the condition, it will never be true, and the breakpoint won't be hit.


I found an example of a condition for an LLDB breakpoint in the answer to the following Stack Overflow question:


How do you add breakpoint actions via the LLDB command line?


If nobody gives you a better answer, I recommend going to Stack Overflow and look at the questions tagged lldb. Stack Overflow would have more people using LLDB from the command line. Most of the people on this forum do their debugging in Xcode, which provides a GUI for adding conditions to breakpoints.

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

How to set conditional breakpoint in lldb, I mean, reliably?

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.