[Lldb-commits] [PATCH] D120320: [lldb/driver] Fix SIGTSTP handling

2022-03-09 Thread Pavel Labath via Phabricator via lldb-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG4bcadd66864b: [lldb/driver] Fix SIGTSTP handling (authored by labath). Changed prior to commit: https://reviews.llvm.org/D120320?vs=412643&id=414078#toc Repository: rG LLVM Github Monorepo CHANGES S

[Lldb-commits] [PATCH] D120320: [lldb/driver] Fix SIGTSTP handling

2022-03-03 Thread Michał Górny via Phabricator via lldb-commits
mgorny accepted this revision. mgorny added a comment. This revision is now accepted and ready to land. LGTM (but I cannot test) Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D120320/new/ https://reviews.llvm.org/D120320 ___

[Lldb-commits] [PATCH] D120320: [lldb/driver] Fix SIGTSTP handling

2022-03-03 Thread Pavel Labath via Phabricator via lldb-commits
labath updated this revision to Diff 412643. labath marked 3 inline comments as done. labath added a comment. Address mgorny's comments. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D120320/new/ https://reviews.llvm.org/D120320 Files: lldb/packa

[Lldb-commits] [PATCH] D120320: [lldb/driver] Fix SIGTSTP handling

2022-03-02 Thread Michał Górny via Phabricator via lldb-commits
mgorny added inline comments. Herald added a project: All. Comment at: lldb/packages/Python/lldbsuite/test/lldbpexpect.py:27 +def launch(self, executable=None, extra_args=None, timeout=60, +dimensions=None, run_under=None, post_spawn=None): logfile = geta

[Lldb-commits] [PATCH] D120320: [lldb/driver] Fix SIGTSTP handling

2022-02-25 Thread Andreu Carminati via Phabricator via lldb-commits
andcarminati added inline comments. Comment at: lldb/tools/driver/Driver.cpp:673-674 +static void sigtstp_handler(int signo) { if (g_driver != nullptr) g_driver->GetDebugger().SaveInputTerminalState(); labath wrote: > JDevlieghere wrote: > > andcarminat

[Lldb-commits] [PATCH] D120320: [lldb/driver] Fix SIGTSTP handling

2022-02-25 Thread Pavel Labath via Phabricator via lldb-commits
labath added inline comments. Comment at: lldb/tools/driver/Driver.cpp:673-674 +static void sigtstp_handler(int signo) { if (g_driver != nullptr) g_driver->GetDebugger().SaveInputTerminalState(); JDevlieghere wrote: > andcarminati wrote: > > JDevliegher

[Lldb-commits] [PATCH] D120320: [lldb/driver] Fix SIGTSTP handling

2022-02-24 Thread Jonas Devlieghere via Phabricator via lldb-commits
JDevlieghere added inline comments. Comment at: lldb/tools/driver/Driver.cpp:673-674 +static void sigtstp_handler(int signo) { if (g_driver != nullptr) g_driver->GetDebugger().SaveInputTerminalState(); andcarminati wrote: > JDevlieghere wrote: > > labat

[Lldb-commits] [PATCH] D120320: [lldb/driver] Fix SIGTSTP handling

2022-02-24 Thread Andreu Carminati via Phabricator via lldb-commits
andcarminati added inline comments. Comment at: lldb/tools/driver/Driver.cpp:673-674 +static void sigtstp_handler(int signo) { if (g_driver != nullptr) g_driver->GetDebugger().SaveInputTerminalState(); JDevlieghere wrote: > labath wrote: > > JDevliegher

[Lldb-commits] [PATCH] D120320: [lldb/driver] Fix SIGTSTP handling

2022-02-24 Thread Jonas Devlieghere via Phabricator via lldb-commits
JDevlieghere added inline comments. Comment at: lldb/tools/driver/Driver.cpp:673-674 +static void sigtstp_handler(int signo) { if (g_driver != nullptr) g_driver->GetDebugger().SaveInputTerminalState(); labath wrote: > JDevlieghere wrote: > > I see an op

[Lldb-commits] [PATCH] D120320: [lldb/driver] Fix SIGTSTP handling

2022-02-24 Thread Pavel Labath via Phabricator via lldb-commits
labath added inline comments. Comment at: lldb/tools/driver/Driver.cpp:673-674 +static void sigtstp_handler(int signo) { if (g_driver != nullptr) g_driver->GetDebugger().SaveInputTerminalState(); JDevlieghere wrote: > I see an opportunity for a little R

[Lldb-commits] [PATCH] D120320: [lldb/driver] Fix SIGTSTP handling

2022-02-23 Thread Jonas Devlieghere via Phabricator via lldb-commits
JDevlieghere added inline comments. Comment at: lldb/tools/driver/Driver.cpp:673-674 +static void sigtstp_handler(int signo) { if (g_driver != nullptr) g_driver->GetDebugger().SaveInputTerminalState(); I see an opportunity for a little RAII helper. Re

[Lldb-commits] [PATCH] D120320: [lldb/driver] Fix SIGTSTP handling

2022-02-23 Thread David Spickett via Phabricator via lldb-commits
DavidSpickett added a comment. Got it, thanks for the explanation. > What's important is that the second signal gets delivered (not "handled", > because at that point we have removed the handler) to the same thread, as > that's the only one we're sure that will have it unblocked (although, in

[Lldb-commits] [PATCH] D120320: [lldb/driver] Fix SIGTSTP handling

2022-02-23 Thread Pavel Labath via Phabricator via lldb-commits
labath marked 4 inline comments as done. labath added a comment. The behavior of the stop signals (SIGTTIN, SIGTTOU, SIGTSTP) is this: - if the process has a signal handler, then the kernel picks an arbitrary thread (which does not have the signal blocked) to handle it. As far as the kernel is

[Lldb-commits] [PATCH] D120320: [lldb/driver] Fix SIGTSTP handling

2022-02-23 Thread David Spickett via Phabricator via lldb-commits
DavidSpickett added a comment. I think I mostly get it and the code looks fine, but my signal foo is weak so @mgorny should give a second look. > we use raise to send the signal, which makes sure it gets delivered to the > thread which is running the handler https://man7.org/linux/man-pages/ma

[Lldb-commits] [PATCH] D120320: [lldb/driver] Fix SIGTSTP handling

2022-02-23 Thread Pavel Labath via Phabricator via lldb-commits
labath marked 4 inline comments as done. labath added inline comments. Comment at: lldb/test/API/driver/job_control/TestJobControl.py:9 +from lldbsuite.test.lldbtest import * +from lldbsuite.test import lldbutil +from lldbsuite.test.lldbpexpect import PExpectTest

[Lldb-commits] [PATCH] D120320: [lldb/driver] Fix SIGTSTP handling

2022-02-23 Thread Pavel Labath via Phabricator via lldb-commits
labath updated this revision to Diff 410800. labath added a comment. Add comments, delete unused code. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D120320/new/ https://reviews.llvm.org/D120320 Files: lldb/packages/Python/lldbsuite/test/lldbpexp

[Lldb-commits] [PATCH] D120320: [lldb/driver] Fix SIGTSTP handling

2022-02-23 Thread David Spickett via Phabricator via lldb-commits
DavidSpickett added inline comments. Comment at: lldb/test/API/driver/job_control/TestJobControl.py:9 +from lldbsuite.test.lldbtest import * +from lldbsuite.test import lldbutil +from lldbsuite.test.lldbpexpect import PExpectTest Unused import?

[Lldb-commits] [PATCH] D120320: [lldb/driver] Fix SIGTSTP handling

2022-02-22 Thread Pavel Labath via Phabricator via lldb-commits
labath created this revision. labath added reviewers: mgorny, DavidSpickett. labath requested review of this revision. Herald added a project: LLDB. Our SIGTSTP handler was working, but that was mostly accidental. The reason it worked is because lldb is multithreaded for most of its lifetime and