[Lldb-commits] [lldb] [lldb-dap] Add testcases for stdio redirection on different console types. (PR #175048)
Sergei Druzhkov via lldb-commits
lldb-commits at lists.llvm.org
Thu Jan 8 11:22:22 PST 2026
================
@@ -720,20 +720,24 @@ llvm::json::Object CreateRunInTerminalReverseRequest(
req_args.push_back("--debugger-pid");
req_args.push_back(std::to_string(debugger_pid));
}
- req_args.push_back("--launch-target");
- req_args.push_back(program.str());
+
if (!stdio.empty()) {
- req_args.push_back("--stdio");
+ req_args.emplace_back("--stdio");
+
std::stringstream ss;
+ std::string_view delimiter;
for (const std::optional<std::string> &file : stdio) {
+ ss << std::exchange(delimiter, ":");
if (file)
- ss << *file;
- ss << ":";
+ ss << file.value();
----------------
DrSergei wrote:
nit: I think we can keep `*file`, because `value()` performs checks that optional contains value. Maybe this check is skipped when we use build wihtout exceptions, but it looks like that we use `*` more often than `value()`
https://github.com/llvm/llvm-project/pull/175048
More information about the lldb-commits
mailing list