[Lldb-commits] [PATCH] D133352: [lldb-server] Report launch error in vRun packets

Jordan Rupprecht via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Wed Sep 7 13:08:12 PDT 2022

rupprecht accepted this revision.
rupprecht added inline comments.
This revision is now accepted and ready to land.

Comment at: lldb/source/Host/posix/ProcessLauncherPosixFork.cpp:293
+    r = llvm::sys::RetryAfterSignal(-1, read, pipe.GetReadFileDescriptor(), pos,
+                                    buf.end() - pos);
+  } while (r > 0);
labath wrote:
> rupprecht wrote:
> > IIUC, this will overrun the buffer if there are >1000 bytes to read; whereas previously we just wouldn't have read everything.
> > 
> > Should each loop iteration grow the buffer by a certain amount? Otherwise I think we need to remove the loop.
> It won't overrun because I am passing the remaining part of the buffer as the size argument. However, I am not totally sure what would happen if we actually filled the buffer (and size becomes zero).  That won't happen right now because the error string is coming from `ExitWithError` (line 50) and its length is limited by the longest errno message. That said, the dynamical resize is quite simple in this case, so I might as well do it.
Thanks! I still think it's good to be dynamic in case this assumption changes one day, and the error string ends up being longer than 1000 bytes.

  rG LLVM Github Monorepo



More information about the lldb-commits mailing list