[Lldb-commits] [PATCH] D154030: [lldb-vscode] Creating a new flag for adjusting the behavior of evaluation repl expressions to allow users to more easily invoke lldb commands.

David Spickett via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Fri Jun 30 01:39:49 PDT 2023


DavidSpickett added a comment.

Some random comments, I'll leave the real review to the VSCode experts.



================
Comment at: lldb/tools/lldb-vscode/JSONUtils.h:239
+///     useful to ensure the same column provided by the setBreakpoints request
+///     are returned to the IDE as a fallback.
 ///
----------------
Appears that this got clang-formatted accidentally. Formatting it is fine but put it in an NFC change if you're gonna do that.

If you aren't already using it, the clang-format-diff script will help you limit formatting to only what you've edited (with occasional extra bits): https://clang.llvm.org/docs/ClangFormat.html


================
Comment at: lldb/tools/lldb-vscode/VSCode.cpp:797
+    g_vsc.repl_mode = ReplMode::Variable;
+    result.AppendMessage("lldb-vscode repl-mode variable set.");
+  } else if (new_mode == "command") {
----------------
There is AppendMessageWithFormat that you could use to avoid repeating the string here.


================
Comment at: lldb/tools/lldb-vscode/VSCode.cpp:805
+  } else {
+    std::string error = "Unknown repl-mode '" + new_mode.str() + "'.";
+    result.SetError(error.c_str());
----------------
Would be useful if it also said: "repl-mode "foo". Expected one of "auto", .....".


================
Comment at: lldb/tools/lldb-vscode/VSCode.cpp:806
+    std::string error = "Unknown repl-mode '" + new_mode.str() + "'.";
+    result.SetError(error.c_str());
+    result.SetStatus(lldb::eReturnStatusFailed);
----------------
SetError ends up calling CommandReturnObject::AppendError which will set the status to failed for you (I changed this a while back because I kept forgetting to set it).


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D154030/new/

https://reviews.llvm.org/D154030



More information about the lldb-commits mailing list