[Lldb-commits] [lldb] [lldb-dap] Refactoring IOStream into Transport handler. (PR #130026)

Jonas Devlieghere via lldb-commits lldb-commits at lists.llvm.org
Thu Mar 6 22:18:37 PST 2025


================
@@ -838,19 +775,16 @@ llvm::Error DAP::Loop() {
     StopEventHandlers();
   });
   while (!disconnecting) {
-    llvm::json::Object object;
-    lldb_dap::PacketStatus status = GetNextObject(object);
-
-    if (status == lldb_dap::PacketStatus::EndOfFile) {
-      break;
-    }
-
-    if (status != lldb_dap::PacketStatus::Success) {
-      return llvm::createStringError(llvm::inconvertibleErrorCode(),
-                                     "failed to send packet");
+    auto next = transport.Read(log);
----------------
JDevlieghere wrote:

I think this goes beyond [LLVM's guidance of auto](https://llvm.org/docs/CodingStandards.html#use-auto-type-deduction-to-make-code-more-readable). It's not obvious from the right hand side what the type of `next` is. 

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


More information about the lldb-commits mailing list