Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the lldb equivalent of gdb's --args?

I'm used to running gdb like so:

$ gdb --args exe --lots --of --flags -a -b -c d e
...
(gdb) r

Is there an equivalent for lldb?

like image 732
Claudiu Avatar asked Oct 29 '15 21:10

Claudiu


People also ask

What is the meaning of LLDB?

LLDB (low-level debugger) is part of LLVM The LLVM compiler (low level virtual machine) creates programming languages. LLDB is Apple's “from the ground up” replacement for GDB. The LLDB debugger is analogous to GDB: (The GNU Project Debugger). Both work on many Unix-like systems and works for many programming languages.

Is LLDB compatible with GDB?

The standard LLDB installation provides you with an extensive set of commands designed to be compatible with familiar GDB commands. In addition to using the standard configuration, you can easily customize LLDB to suit your needs. Both GDB and LLDB are of course excellent debuggers without doubt.

How do you 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 GDB LLDB?

Definition. LLDB is the debugger component of the LLVM project. But, GDB is a portable debugger that runs on many UNIX like systems and works for many programming languages. Thus, this is the main difference between LLDB and GDB.


2 Answers

Yes, it's just -- instead of --args. From the help:

lldb -v [[--] <PROGRAM-ARG-1> [<PROGRAM_ARG-2> ...]]

Thus:

$ lldb -- exe --lots --of --flags -a -b -c d e
like image 60
Claudiu Avatar answered Sep 23 '22 10:09

Claudiu


You can also start lldb first and use:

(lldb) settings set target.run-args 1 2 3
(lldb) run

or:

(lldb) process launch -- <args>
like image 42
Patryk Gawroński Avatar answered Sep 23 '22 10:09

Patryk Gawroński