[Lldb-commits] [lldb] [lldb-dap] Add feature to remember last non-empty expression. (PR #107485)

John Harrison via lldb-commits lldb-commits at lists.llvm.org
Mon Sep 9 09:21:58 PDT 2024


================
@@ -1364,6 +1364,13 @@ void request_evaluate(const llvm::json::Object &request) {
   std::string expression = GetString(arguments, "expression").str();
   llvm::StringRef context = GetString(arguments, "context");
 
+  // Remember the last non-empty expression from the user, and use that if
+  // the current expression is empty (i.e. the user hit plain 'return').
+  if (!expression.empty())
+    g_dap.last_nonempty_expression = expression;
+  else
----------------
ashgti wrote:

Should this be done using https://github.com/llvm/llvm-project/blob/ea2da571c761066542f8d2273933d2523279e631/lldb/include/lldb/API/SBCommandInterpreterRunOptions.h#L77-L81 on the https://github.com/llvm/llvm-project/blob/ea2da571c761066542f8d2273933d2523279e631/lldb/tools/lldb-dap/LLDBUtils.cpp#L48C14-L48C27 call?

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


More information about the lldb-commits mailing list