Partially fixes PR38222
Details
- Reviewers
teemperor zturner stella.stamenova - Commits
- rGd75a8fff7f6f: Do not create new terminals when launching process on Windows with --no-stdio
rL342075: Do not create new terminals when launching process on Windows with --no-stdio
rLLDB342075: Do not create new terminals when launching process on Windows with --no-stdio
Diff Detail
- Repository
- rLLDB LLDB
Event Timeline
I think the issue here is that on windows we don't have the ability(*) to pipe stdio through lldb, so if you create a process without a console, you will not be able to use see it's output or pass it some input (probably fine for gui apps, but bad for console ones). This means your approach will also make things inconsistent with other platforms, only in a different way. (I don't really have an opinion which one is better/worse.)
(*) I think there is a way to emulate the unix pty behavior on windows, but it is not exactly straight-forward. It involves creating a hidden console and then polling that for changes/keypresses (I don't know the details, but that's how someone once explained it to me).
I also thought about it and I am in favour of this solution. Suggestions welcome, especially from @zturner, @labath, @JDevlieghere , @teemperor, ..
The other option is to only remove this flag if "--no-stdio" is set.
The best solution IMHO is:
- find a way to get stdio from a process and feed to to LLDB so it shows up when neither --tty nor --no-stdio is set
- when --tty is specified, set the CREATE_NEW_CONSOLE bit
- when --no-stdio is specified, don't get stdio from child process and don't set CREATE_NEW_CONSOLE
So basically the hardest problem is to "find a way to get stdio from a process and feed to to LLDB so it shows up when neither --tty nor --no-stdio is set" ..
yes. The easier solution is to just create a console for now if this is too hard. So the fix here would be to just not set the CREATE_NEW_CONSOLE if --no-stdio is set.
This makes sense to me, but the windows folks should say what is best for their platform.