Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Set breakpoint on specific line using LLDB

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
like image 439
Andrew Tuzson Avatar asked Nov 29 '17 14:11

Andrew Tuzson


People also ask

What command do you use to set a breakpoint?

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.

Which is better LLDB or GDB?

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.

How do you set a breakpoint in CPP?

In a C++ project, start debugging, and wait until a breakpoint is reached. On the Debug menu, choose New Breakpoint > Data Breakpoint.


1 Answers

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
like image 130
Scriptable Avatar answered Oct 25 '22 08:10

Scriptable