Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Print multiple variables with one command in LLDB

Tags:

lldb

This is possible with Print multiple variables with one command in GDB, but how to do it with LLDB?

like image 961
user744629 Avatar asked Jul 10 '15 09:07

user744629


People also ask

How do you make 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 command?

lldb is a next generation, high-performance debugger. It is built as a set of reusable components which highly leverage existing libraries in the larger LLVM Project, such as the Clang expression parser and LLVM disassembler.

Does LLDB have Tui?

You can also expand the regsiters by register class: I'd like to know how to resize the various windows. If you resize the terminal, the size of the stack view pane seems to remain fixed, so the symbol names always end up truncated.

How do I use LLDB code?

Loading a Program into lldb First we need to set the program to debug. As with gdb, you can start lldb and specify the file you wish to debug on the command line: $ lldb /Projects/Sketch/build/Debug/Sketch. app Current executable set to '/Projects/Sketch/build/Debug/Sketch.


2 Answers

If all you want is to print variables, then

(lldb) frame variable var1 var2 var3 var4

will do it for you

But if you're trying to actually evaluate expressions instead of just printing local variables, then that will not work.

like image 137
Enrico Granata Avatar answered Oct 19 '22 23:10

Enrico Granata


To get the same result , you can log messages with Xcode Breakpoints.

writing:

@var1@ @var2@ @var3@ @var4@

more details:

var1 is @var1@ , var2 is @var2@, var3 is @var3@ , var4 is @var4@

showing a pic:

one

more intuitive, you could use multiple debug command

just like

two

like image 36
dengST30 Avatar answered Oct 19 '22 22:10

dengST30