[Lldb-commits] [lldb] [lldb] Fix dwim-print to not delete non-result persistent variables (PR #85152)

via lldb-commits lldb-commits at lists.llvm.org
Fri Mar 15 11:38:57 PDT 2024


jimingham wrote:

That's an okay approach if the only time an expression produces a result variable dwim-print should not delete is when a persistent variable is explicitly mentioned.  But anyway, since that's the case we're fixing, and checking as a persistent variable as a short-cut early on isn't a bad idea, it is fine for these purposes.

I think you need to get the persistent variables for whatever the language of the expression happens to be, not just get all the persistent variables. Otherwise, if you define a C persistent variable, then stop in a swift frame and do:

(lldb) p $works_in_c
10
(lldb) p $works_in_c + 10
unknown identifier "$works_in_c"

which would be confusing.


https://github.com/llvm/llvm-project/pull/85152


More information about the lldb-commits mailing list