[Lldb-commits] [lldb] [lldb-dap] Use existing lldb::IOObjectSP for DAP IO (NFC). (PR #128750)

Pavel Labath via lldb-commits lldb-commits at lists.llvm.org
Thu Feb 27 01:14:54 PST 2025


labath wrote:

> The one issue with this is that MainLoop on Windows only supports sockets, not Files. At the moment we primarily work over stdin/stdout for communication, although the `--connection` flag is in now, so we can support sockets.

Okay, I think I understand what you're saying. With the connection flag, we're communicating over sockets, and we only need to force termination in the socket case. However, the code that actually reads from the socket is generic and also needs to work in the "regular" mode -- which communicates over stdin/out.

> I do think we could merge some of these threads if MainLoop supported Files on Windows. That may be worth tackling specifically to unblock this behavior.

That would be very nice, but I think that would have do be on you mostly. I should be able to support you with e.g. windows bits, but I don't think I'd be able to do everything. I'm actually sitting on a Socket refactor patch for a couple of months now that I haven't had time to clean up and submit.

I do think we should do something about the close-in-another-thread thingy (it's an anti pattern that tends to show up a lot, and I'm very getting sensitive to it :/). Would it be possible to refactor the reading code so that it goes through the main loop if we're communicating over a socket, and reads directly from the IOObject otherwise? I don't expect the result to be pretty, but it feels like it should be possible to make it not-completely-ugly.

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


More information about the lldb-commits mailing list