[Lldb-commits] [lldb] [lldb-dap] Don't duplicate script output in the evaluate response (PR #232583)

Nathan Fusselman via lldb-commits lldb-commits at lists.llvm.org
Tue Oct 20 07:56:39 PDT 2026


================
@@ -118,13 +118,16 @@ EvaluateRequestHandler::Run(const EvaluateArguments &arguments) const {
                          /*add_to_history=*/true);
 
     if (!result.Succeeded()) {
+      const char *error = result.GetError(/*only_if_no_immediate=*/true);
       return llvm::make_error<DAPError>(
-          std::string(result.GetError(), result.GetErrorSize()),
+          error ? std::string(error, result.GetErrorSize()) : std::string(),
----------------
nathanfusselman wrote:

Correct, we do not have a size for the non-immediate variant. I figured it was good protection to set an upper bound in case null termination was missing but either way is fine I can use the non length based initializer.

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


More information about the lldb-commits mailing list