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

2024-03-13 Thread Dave Lee via lldb-commits
https://github.com/kastiglione created https://github.com/llvm/llvm-project/pull/85152 None >From 970cf82fa3d64c5a4e1b3929c110b42974ef13cd Mon Sep 17 00:00:00 2001 From: Dave Lee Date: Wed, 13 Mar 2024 14:49:23 -0700 Subject: [PATCH] [lldb] Fix dwim-print to not delete non-result persistent v

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

2024-03-13 Thread via lldb-commits
llvmbot wrote: @llvm/pr-subscribers-lldb Author: Dave Lee (kastiglione) Changes --- Full diff: https://github.com/llvm/llvm-project/pull/85152.diff 2 Files Affected: - (modified) lldb/source/Commands/CommandObjectDWIMPrint.cpp (+10-2) - (modified) lldb/test/API/commands/dwim-print/Te

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

2024-03-13 Thread Dave Lee via lldb-commits
https://github.com/kastiglione edited https://github.com/llvm/llvm-project/pull/85152 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

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

2024-03-13 Thread via lldb-commits
@@ -170,6 +170,14 @@ void CommandObjectDWIMPrint::DoExecute(StringRef command, ExpressionResults expr_result = target.EvaluateExpression( expr, exe_scope, valobj_sp, eval_options, &fixed_expression); +auto persistent_name = valobj_sp->GetName(); +// Evaluat

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

2024-03-14 Thread Dave Lee via lldb-commits
@@ -170,6 +170,14 @@ void CommandObjectDWIMPrint::DoExecute(StringRef command, ExpressionResults expr_result = target.EvaluateExpression( expr, exe_scope, valobj_sp, eval_options, &fixed_expression); +auto persistent_name = valobj_sp->GetName(); +// Evaluat

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

2024-03-14 Thread via lldb-commits
@@ -170,6 +170,14 @@ void CommandObjectDWIMPrint::DoExecute(StringRef command, ExpressionResults expr_result = target.EvaluateExpression( expr, exe_scope, valobj_sp, eval_options, &fixed_expression); +auto persistent_name = valobj_sp->GetName(); +// Evaluat

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

2024-03-14 Thread Dave Lee via lldb-commits
https://github.com/kastiglione edited https://github.com/llvm/llvm-project/pull/85152 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

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

2024-03-15 Thread Dave Lee via lldb-commits
https://github.com/kastiglione edited https://github.com/llvm/llvm-project/pull/85152 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

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

2024-03-15 Thread Dave Lee via lldb-commits
https://github.com/kastiglione updated https://github.com/llvm/llvm-project/pull/85152 >From 970cf82fa3d64c5a4e1b3929c110b42974ef13cd Mon Sep 17 00:00:00 2001 From: Dave Lee Date: Wed, 13 Mar 2024 14:49:23 -0700 Subject: [PATCH 1/2] [lldb] Fix dwim-print to not delete non-result persistent var

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

2024-03-15 Thread Dave Lee via lldb-commits
@@ -170,6 +170,14 @@ void CommandObjectDWIMPrint::DoExecute(StringRef command, ExpressionResults expr_result = target.EvaluateExpression( expr, exe_scope, valobj_sp, eval_options, &fixed_expression); +auto persistent_name = valobj_sp->GetName(); +// Evaluat

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

2024-03-15 Thread Dave Lee via lldb-commits
https://github.com/kastiglione edited https://github.com/llvm/llvm-project/pull/85152 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

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

2024-03-15 Thread via lldb-commits
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

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

2024-03-15 Thread Dave Lee via lldb-commits
kastiglione wrote: I'll change this to scope lookup of persistent variables to the expected language. However, there's an argument to be made that `dwim-print $my_var` should work anywhere. I think that follows the spirit of "do what I mean". Maybe in the future I'll propose that in a separat

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

2024-03-15 Thread via lldb-commits
jimingham wrote: The counter to this is that `dwim-print` differs from `frame var` in that it supports complex expressions. So having it work for simple statements of a variable name (what frame var and target var already do just fine) but then fail when the SAME name is used in a slightly mo

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

2024-03-15 Thread Dave Lee via lldb-commits
https://github.com/kastiglione updated https://github.com/llvm/llvm-project/pull/85152 >From 970cf82fa3d64c5a4e1b3929c110b42974ef13cd Mon Sep 17 00:00:00 2001 From: Dave Lee Date: Wed, 13 Mar 2024 14:49:23 -0700 Subject: [PATCH 1/3] [lldb] Fix dwim-print to not delete non-result persistent var

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

2024-03-15 Thread Dave Lee via lldb-commits
kastiglione wrote: I don't consider it a failure to not be able to perform mixed language expressions. But it would have to be presented to the user in a way that is understandable, which could be a challenge. Anyway, I pushed the change that scopes the lookup to the expected language. thank

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

2024-03-15 Thread via lldb-commits
jimingham wrote: > I don't consider it a failure to not be able to perform mixed language > expressions. But it would have to be presented to the user in a way that is > understandable, which could be a challenge. > > Anyway, I pushed the change that scopes the lookup to the expected language.

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

2024-03-15 Thread via lldb-commits
https://github.com/jimingham approved this pull request. LGTM https://github.com/llvm/llvm-project/pull/85152 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

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

2024-03-15 Thread Dave Lee via lldb-commits
kastiglione wrote: > I'm not sure what you mean by "mixed language expressions". I was thinking about the case where a user attempts `p $some_c_var + 1` in Swift frame – which is valid swift as far as the debugger is concerned. https://github.com/llvm/llvm-project/pull/85152 _

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

2024-03-15 Thread Dave Lee via lldb-commits
https://github.com/kastiglione closed https://github.com/llvm/llvm-project/pull/85152 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

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

2024-03-15 Thread via lldb-commits
jimingham wrote: > > I'm not sure what you mean by "mixed language expressions". > > I was thinking about the case where a user attempts `p $some_c_var + 1` in > Swift frame – which is valid swift as far as the debugger is concerned. I > said mixed because it's got a C var inside a Swift expre