From: Dave Lee Date: Mon, 6 Mar 2023 23:06:25 +0000 (-0800) Subject: [lldb-vscode] Use `expression` command for completion X-Git-Tag: upstream/17.0.6~15595 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=e221dab07815016fb04deb5d38441e77d1cd300a;p=platform%2Fupstream%2Fllvm.git [lldb-vscode] Use `expression` command for completion Change lldb-vscode to use the `expression` command for generating completions, instead of the `p` alias. Aliases are user overrideable, and even deletable, but the `expression` command is unchangeable. See D141539 where a similar replacement was done to tests. Differential Revision: https://reviews.llvm.org/D145437 --- diff --git a/lldb/tools/lldb-vscode/lldb-vscode.cpp b/lldb/tools/lldb-vscode/lldb-vscode.cpp index b70f5b0..51a72f2 100644 --- a/lldb/tools/lldb-vscode/lldb-vscode.cpp +++ b/lldb/tools/lldb-vscode/lldb-vscode.cpp @@ -1065,8 +1065,9 @@ void request_completions(const llvm::json::Object &request) { text = text.substr(1); actual_column--; } else { - text = "p " + text; - actual_column += 2; + char command[] = "expression -- "; + text = command + text; + actual_column += strlen(command); } lldb::SBStringList matches; lldb::SBStringList descriptions;