aboutsummaryrefslogtreecommitdiff
path: root/lldb/source/Plugins/Process/MacOSX-Kernel/ProcessKDP.cpp
diff options
context:
space:
mode:
authorJohn Harrison <harjohn@google.com>2024-01-17 09:00:22 -0800
committerGitHub <noreply@github.com>2024-01-17 09:00:22 -0800
commit4ea1994a0307b09532d519292d34dad7555598ca (patch)
treebe61c2526b5e1ed7d3e77ed0de93aa2163f099a9 /lldb/source/Plugins/Process/MacOSX-Kernel/ProcessKDP.cpp
parent2cd013a7869a341a6536324c34f0c4e68bf01a38 (diff)
downloadllvm-4ea1994a0307b09532d519292d34dad7555598ca.zip
llvm-4ea1994a0307b09532d519292d34dad7555598ca.tar.gz
llvm-4ea1994a0307b09532d519292d34dad7555598ca.tar.bz2
[lldb-dap] Adjusting how repl-mode auto determines commands vs variable expressions. (#78005)
The previous logic for determining if an expression was a command or variable expression in the repl would incorrectly identify the context in many common cases where a local variable name partially overlaps with the repl input. For example: ``` int foo() { int var = 1; // break point, evaluating "p var", previously emitted a warning } ``` Instead of checking potentially multiple conflicting values against the expression input, I updated the heuristic to only consider the first term. This is much more reliable at eliminating false positives when the input does not actually hide a local variable. Additionally, I updated the warning on conflicts to occur anytime the conflict is detected since the specific conflict can change based on the current input. This also includes additional details on how users can change the behavior. Example Debug Console output from lldb/test/API/tools/lldb-dap/evaluate/main.cpp:11 breakpoint 3. ``` lldb-dap> var + 3 Warning: Expression 'var' is both an LLDB command and variable. It will be evaluated as a variable. To evaluate the expression as an LLDB command, use '`' as a prefix. 45 lldb-dap> var + 1 Warning: Expression 'var' is both an LLDB command and variable. It will be evaluated as a variable. To evaluate the expression as an LLDB command, use '`' as a prefix. 43 ```
Diffstat (limited to 'lldb/source/Plugins/Process/MacOSX-Kernel/ProcessKDP.cpp')
0 files changed, 0 insertions, 0 deletions