[Lldb-commits] [PATCH] D145609: [lldb] Change dwim-print to default to disabled persistent results

Dave Lee via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Thu Mar 23 10:22:32 PDT 2023


kastiglione added a comment.

> Also `--persistent-result on` can't be passed to print, it only works for me if I run specifically `dwim-print`. Is that intended?

The intension is that for users who want persistent results enabled can do so by customizing their `p` or `print` alias, like so:

  command unalias print
  command alias print dwim-print --persistent-result on --



> What was the rationale for this change? It changes the output format of a common command (given that `print` is now an alias for `dwim-print`) and it breaks basically anything that examines debugger output.

Are you using persistent results? If not, how much effort is it to either 1) change the tools/code that examine the output to not look for `$\d+`, or 2) use a custom `print`/`p` alias? Honest question.

The rationale is: `dwim-print` doesn't always use expression evaluation, it prefers to use `frame variable` where possible. In the future it could be expanded, for example to print register as well. Because `dwim-print` doesn't always use `expression`, there isn't always a persistent result. To make `dwim-print` output consistent, and because it's presumed most users don't use persistent results, we changed `dwim-print` to default to no persistent results. By consistent output, I mean that if a user runs `print someVar` and then follows that by running `print someVar.dump()`, it could be confusing if the first command doesn't have a persistent result, but the second one does.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D145609



More information about the lldb-commits mailing list