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
_______________________________________________
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

Reply via email to