[Lldb-commits] [PATCH] D132395: [lldb] [gdb-remote] Use Communication::WriteAll() over Write()

Pavel Labath via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Tue Sep 6 05:35:39 PDT 2022


labath added a comment.

I just ran into a similar problem, and I realized that (at least for reading) there are actually *three* variants of these calls that can be useful, depending on the case.

1. perform exactly one syscall, return what you get -- important when you don't want to block
2. read/write as much as you can, but also settle for less -- for example you may not know how much data there is, but you want to read all of it
3. read/write *exactly* the given data, error out if less -- when you know exactly how much you want to read, and anything less is useless

Implementing one on top of the other is easy, but conveying the desired semantics in a reasonably short name is not.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D132395/new/

https://reviews.llvm.org/D132395



More information about the lldb-commits mailing list