I am attempting to set a breakpoint on line 37 of my project in Xcode and I want to set this using LLDB. I know that I can set this breakpoint manually by clicking in the gutter, but I want to gain a better understanding of using LLDB. How would I build off of the statement below? Is that statement even heading in the correct direction?
breakpoint set --file
Setting breakpoints. Breakpoints are set with the break command (abbreviated b ). The debugger convenience variable `$bpnum' records the number of the breakpoint you've set most recently; see section Convenience variables, for a discussion of what you can do with convenience variables.
In brief, LLDB and GDB are two debuggers. The main difference between LLDB and GDB is that in LLDB, the programmer can debug programs written in C, Objective C and C++ while, in GDB, the programmer can debug programs written in Ada, C, C++, Objective C, Pascal, FORTRAN and Go.
In a C++ project, start debugging, and wait until a breakpoint is reached. On the Debug menu, choose New Breakpoint > Data Breakpoint.
Reference the documentation here
It looks like you can set a breakpoint in a particular file and line by using
(lldb) breakpoint set --file test.c --line 12
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With