[Lldb-commits] [PATCH] D115974: [formatters] Improve documentation

Greg Clayton via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Sun Dec 19 18:22:12 PST 2021


clayborg added inline comments.


================
Comment at: lldb/docs/use/variable.rst:77
+which is what the user would expect from a good debugger.
+
 There are several features related to data visualization: formats, summaries,
----------------
jingham wrote:
> jingham wrote:
> > This is a nice example, but we should also/instead use an example with `v` for two reasons.
> > 
> > First, `p` is super overkill as a way to print a local variable called a_deque, `v` is the preferred tool.
> > Second, `v` actually understands synthetic children, so you can also do:
> > 
> > (lldb) v a_deque[0]
> > 
> > if you only want to see the first element, etc.
> > 
> > This can be convenient, and may not be as widely known.
> It also might be worth pointing out - since you have the example on hand - that the "size=5" bit of that display is the work of the summary formatter?
Yeah, p will invoke the expression parser and "v' is an alias to "frame variable". I would vote to just use "frame variable" instead of the "v" shortcut to make it more readable.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D115974/new/

https://reviews.llvm.org/D115974



More information about the lldb-commits mailing list