Enable stdio forwarding when nonstop mode is enabled, and disable it
once it is disabled. This makes it possible to cleanly handle stdio
forwarding while running multiple processes in non-stop mode.
Sponsored by: The FreeBSD Foundation
Paths
| Differential D128932
[lldb] [llgs] Improve stdio forwarding in multiprocess+nonstop ClosedPublic Authored by mgorny on Jun 30 2022, 11:26 AM.
Details Summary Enable stdio forwarding when nonstop mode is enabled, and disable it Sponsored by: The FreeBSD Foundation
Diff Detail Event Timeline
Comment Actions Use semaphores to sync instead of relying on ugly sleeps.
Comment Actions I have a feeling the semaphores will not work (compile) on darwin. I didn't find any sem_init call there -- just sem_open. Maybe instead of semaphores we could use files for the synchronization? Something similar to the wait_for_file_on_target function, just in the other direction. Then the test could create a file to move the processes forward? (This might be easier to achieve with a dedicated inferior, instead of trying to fit it into the universal LLGS inferior.)
Comment Actions
Damn, and I thought POSIX actually means something to Darwin. Yeah, I'll look into using some other synchronization mechanism.
Comment Actions Ok, let's give this a shot.
This revision is now accepted and ready to land.Jul 7 2022, 4:00 AM
mgorny added a parent revision: D129652: [lldb] [llgs] Convert m_debugged_processes into a map of structs.Jul 13 2022, 9:03 AM This revision was landed with ongoing or failed builds.Jul 15 2022, 1:12 PM Closed by commit rG09531ede6d56: [lldb] [llgs] Improve stdio forwarding in multiprocess+nonstop (authored by mgorny). · Explain Why This revision was automatically updated to reflect the committed changes. Comment Actions Flake here: https://lab.llvm.org/buildbot/#/builders/68/builds/36967. Presumably the same problem that cd18e2ea3f4e87f8804a7d6661d5596ef1f07b81 fixed for TestNonStop. Comment Actions
Thanks for the ping and the suggestion. I'm testing a fix right now and will push if it works ;-).
Revision Contents
Diff 441664 lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.cpp
lldb/test/API/tools/lldb-server/TestGdbRemoteForkNonStop.py
lldb/test/API/tools/lldb-server/main.cpp
|
In the multiprocess all-stop mode, if one process stops, we are supposed to stop all of them, right? I take it that's not something we do right now, is it?