[Lldb-commits] [lldb] [lldb] Fixed PipeWindows bugs; added Pipe::WriteWithTimeout() (PR #101383)

Dmitry Vasilyev via lldb-commits lldb-commits at lists.llvm.org
Sat Aug 3 09:09:03 PDT 2024


slydiman wrote:

I have reverted the original `PipeWindows::CreateNew()` removed in this [commit](https://github.com/llvm/llvm-project/commit/e55850be23a09969a3a619c4767d86cd532b1006). Note the following comment was here at the beginning and it is correct. See also [here for more details](https://stackoverflow.com/questions/60645/overlapped-i-o-on-anonymous-pipe).

> Even for anonymous pipes, we open a named pipe. This is because you cannot get overlapped i/o on Windows without using a named pipe.  So we synthesize a unique name.

We cannot use ::CreatePipe() because this pipe does not support async I/O. 

Note the inheritance did not work for name pipes on Windows because of missing or incorrectly initialized SECURITY_ATTRIBUTES.

Note ReadWithTimeout() never worked as expected because of `timeout = duration.count() * 1000;` instead of `timeout = duration.count() / 1000;`. 

I have also fixed the logic of error checking.


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


More information about the lldb-commits mailing list