================ @@ -311,10 +309,22 @@ void DAP::SendOutput(OutputType o, const llvm::StringRef output) { category = "telemetry"; break; } - body.try_emplace("category", category); - EmplaceSafeString(body, "output", output.str()); - event.try_emplace("body", std::move(body)); - SendJSON(llvm::json::Value(std::move(event))); + + // Send each line of output as an individual event, including the newline if + // present. + ::size_t idx = 0; + do { + ::size_t end = output.find('\n', idx); + if (end == llvm::StringRef::npos) + end = output.size() - 1; + llvm::json::Object event(CreateEventObject("output")); + llvm::json::Object body; + body.try_emplace("category", category); + EmplaceSafeString(body, "output", output.slice(idx, end + 1).str()); + event.try_emplace("body", std::move(body)); + SendJSON(llvm::json::Value(std::move(event))); + idx = end + 1; + } while (idx < output.size()); ---------------- vogelsgesang wrote:
Thanks for clarifying! https://github.com/llvm/llvm-project/pull/105456 _______________________________________________ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits