================ @@ -1376,6 +1382,16 @@ void request_evaluate(const llvm::json::Object &request) { EmplaceSafeString(body, "result", result); body.try_emplace("variablesReference", (int64_t)0); } else { + if (context == "repl") { + // If the expression is empty and the last expression was for a + // variable, set the expression to the previous expression (repeat the + // evaluation); otherwise save the current non-empty expression for the + // next (possibly empty) variable expression. + if (expression.empty()) + expression = g_dap.last_nonempty_var_expression; ---------------- walter-erquinigo wrote:
IIUC, this has the following flow in the debug console: - You send a command (non-var expression) FOO - You send a var expression VAR - You send empty text -> then FOO repeats If that understanding is correct, that would lead to a confusing behavior. I think it's better to repeat only if the previous input was exactly a command. https://github.com/llvm/llvm-project/pull/107485 _______________________________________________ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits