This adds some important remarks to the data formatter documentation.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
Those are useful tips, thanks!
lldb/docs/use/variable.rst | ||
---|---|---|
81 | 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. (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. |
lldb/docs/use/variable.rst | ||
---|---|---|
81 | 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? |
lldb/docs/use/variable.rst | ||
---|---|---|
81 | 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. |
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.