This revision was automatically updated to reflect the committed changes. Closed by commit rGd252d9231c4a: [lldb] Fix spurious assertion in PrintCommandOutput (authored by JDevlieghere). Herald added a project: LLDB.
Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D126081/new/ https://reviews.llvm.org/D126081 Files: lldb/source/Interpreter/CommandInterpreter.cpp Index: lldb/source/Interpreter/CommandInterpreter.cpp =================================================================== --- lldb/source/Interpreter/CommandInterpreter.cpp +++ lldb/source/Interpreter/CommandInterpreter.cpp @@ -2989,22 +2989,18 @@ lldb::StreamFileSP stream = is_stdout ? io_handler.GetOutputStreamFileSP() : io_handler.GetErrorStreamFileSP(); // Split the output into lines and poll for interrupt requests - size_t size = str.size(); - while (size > 0 && !WasInterrupted()) { + while (!str.empty() && !WasInterrupted()) { llvm::StringRef line; - size_t written = 0; std::tie(line, str) = str.split('\n'); { std::lock_guard<std::recursive_mutex> guard(io_handler.GetOutputMutex()); - written += stream->Write(line.data(), line.size()); - written += stream->Write("\n", 1); + stream->Write(line.data(), line.size()); + stream->Write("\n", 1); } - lldbassert(size >= written); - size -= written; } std::lock_guard<std::recursive_mutex> guard(io_handler.GetOutputMutex()); - if (size > 0) + if (!str.empty()) stream->Printf("\n... Interrupted.\n"); stream->Flush(); }
Index: lldb/source/Interpreter/CommandInterpreter.cpp =================================================================== --- lldb/source/Interpreter/CommandInterpreter.cpp +++ lldb/source/Interpreter/CommandInterpreter.cpp @@ -2989,22 +2989,18 @@ lldb::StreamFileSP stream = is_stdout ? io_handler.GetOutputStreamFileSP() : io_handler.GetErrorStreamFileSP(); // Split the output into lines and poll for interrupt requests - size_t size = str.size(); - while (size > 0 && !WasInterrupted()) { + while (!str.empty() && !WasInterrupted()) { llvm::StringRef line; - size_t written = 0; std::tie(line, str) = str.split('\n'); { std::lock_guard<std::recursive_mutex> guard(io_handler.GetOutputMutex()); - written += stream->Write(line.data(), line.size()); - written += stream->Write("\n", 1); + stream->Write(line.data(), line.size()); + stream->Write("\n", 1); } - lldbassert(size >= written); - size -= written; } std::lock_guard<std::recursive_mutex> guard(io_handler.GetOutputMutex()); - if (size > 0) + if (!str.empty()) stream->Printf("\n... Interrupted.\n"); stream->Flush(); }
_______________________________________________ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits