[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 11:37:36 PDT 2023


kastiglione added a comment.

> Oh, so in the cases where `dwim-print` delegates to frame variable you can't then refer to that result in another `dwim-print` command/other place where you'd like to reference a previously printed value?

If the variable is in scope, you can use the variable. If it's not in scope, can you tell me about the workflows that you'd use it in?

> That seems like a significant regression over existing print functionality and compared to gdb. At least for me that'd be annoying/inconvenient to have to think about which kind of printing I'm doing (& have to explicitly use the less stable full expression based printing) when I want to reuse a value.

Our expectation is that for users such as yourself, the solution is to customize the `p` alias, or alternatively create a separate alias, like `pr` (print w/ result). Does that seem reasonable? My plan is to use `e` for the cases where I want persistent results, since `expression` still defaults to persisting result variables.

> Got data on that? I'd /guess/ I use it maybe in single digit % of my prints, but probably at least 1%, though no idea if that's representative - even if it is, the inconsistency feels counter to the goals of dwim-print & the convenience provided by gdb's consistent value handling.

Re data: only anecdotal. I expect that those of us who work on lldb represent the biggest users of persistent results, but how much is that? You estimate 1%. I use it less than that, maybe one out of a thousand (0.01%), but probably less. @aprantl has mentioned he's more likely to hit the up arrow and edit a previous command than use persistent results, which I can see being true for most users.

It's not that the ability is taken away, only that the default is being set to match the majority of cases – the 99+% of prints don't need a persistent result.


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