[Lldb-commits] [lldb] [lldb] Synchronize the debugger's stdout and stderr streams (PR #126630)

Jonas Devlieghere via lldb-commits lldb-commits at lists.llvm.org
Fri Feb 14 16:29:53 PST 2025


JDevlieghere wrote:

> > A random idea, I don't know if it's a good one: have one object (LockableStreamPair?) that holds the two streams and their mutex. One less argument to pass around?
> 
> Sounds good, that simplifies the signatures (which this PR is already touching) and keeps the mutex abstracted away.

I did implement this and I'm not happy with the result: even though you only pass one object, you still need to get the output or error stream out of it which ends up being more verbose. And because of the `IOHandler` and `Debugger::AdoptTopIOHandlerFilesIfInvalid` it needs to be a shared pointer. Here's what that looks like: https://github.com/llvm/llvm-project/commit/d62fdaec4cd322574e1ab78c8cacd1effe2c29c0. It compiles but some tests are failing. Probably something small but given I don't like the approach I haven't looked into it. 

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


More information about the lldb-commits mailing list