hlin117
hlin117

Reputation: 22250

Documentation for LLDB's GUI

I've been recently been playing around with LLDB's gui feature. (A stackoverflow link about this feature is described here. My current lldb is lldb-320.4.156)

So far, it seems very convenient, especially the ability to view local variables in the current stack frame. But is there any documentation (or tutorial) on how to use the LLDB's GUI mode?


Aside: I specifically have a few questions:

  1. How to show the source code upon going into GUI mode. (Unless I stop at a breakpoint and type gui within LLDB, I can never get source code to show up.)
  2. How to rerun a program while in GUI mode. (There is nowhere to type while in GUI mode.)
  3. Are there colors in GUI mode? I notice if you type lldb --help in the command line, lldb tells you you could invoke it with a --no-use-colors option. (That being said, I've never seen colors with normal lldb mode...)
  4. Is there a way to set breakpoints, prior to running lldb?

Upvotes: 15

Views: 21454

Answers (3)

ynn
ynn

Reputation: 4815

But is there any documentation (or tutorial) on how to use the LLDB's GUI mode?

I don't know any official documentation. But this random video was helpful for me. Also, pressing h in TUI gives you a minimal documentation.

1. How to show the source code upon going into GUI mode. (Unless I stop at a breakpoint and type gui within LLDB, I can never get source code to show up.)

As you observed, unless gui command is executed while the program is paused due to a breakpoint or something, nothing happens in TUI.

2. How to rerun a program while in GUI mode. (There is nowhere to type while in GUI mode.)

AFAIK, impossible. Press Esc and execute run again.

3. Are there colors in GUI mode? I notice if you type lldb --help in the command line, lldb tells you you could invoke it with a --no-use-colors option. (That being said, I've never seen colors with normal lldb mode...)

In my environment (M1 Macbook Air), color works with no option (i.e. by default) both in CUI and TUI.

4. Is there a way to set breakpoints, prior to running lldb?

See @Johan's answer. You can also use ~/.lldbinit file if the breakpoint condition is fixed.

Upvotes: 5

Johan
Johan

Reputation: 265

Don't have an answer for all your questions, but regarding breakpoints, you can save all your debug session "setup" commands in a file and then just load that file:

lldb -S <filename>

Found this option from here: https://stackoverflow.com/a/34275770/1345329

Upvotes: 0

Jason Molenda
Jason Molenda

Reputation: 15375

The GUI mode in lldb is a feature that Greg Clayton did over a few weeks of nights & weekends -- it's a really cool hack. But it's not completed to product-quality level and there's no documentation short of the command key tips that you can see with its built in help system. The biggest omission is definitely the lack of a console window where you could type arbitrary lldb commands - but adding a console pane like that was where things started to get tricky. :)

Hopefully an interested developer will pick up the gui mode work and add these features. For people who can't use a full IDE, it can be really helpful to have a text mode windowed UI when using a debugger.

Upvotes: 8

Related Questions