[Lldb-commits] [lldb] [lldb] Handle signals in a separate thread in the driver (PR #134956)
Jonas Devlieghere via lldb-commits
lldb-commits at lists.llvm.org
Wed Apr 9 16:02:23 PDT 2025
JDevlieghere wrote:
@labath I originally used the MainLoop to handle `SIGINT` on non-Windows platforms and that didn't caused two test failures. I was able to reproduce the weird behavior by hand.
With the current SIGINT handler:
```
(lldb) script
Python Interactive Interpreter. To exit, type 'quit()', 'exit()' or Ctrl-D.
>>>
```
I send a CTRL-C and a KeyboardInterrupt shows up immediately on screen:
```
(lldb) script
Python Interactive Interpreter. To exit, type 'quit()', 'exit()' or Ctrl-D.
>>>
KeyboardInterrupt
```
With the [MainLoop SIGINT handler](https://github.com/llvm/llvm-project/commit/3943112f5182065eed43d72e2960ed166737b237):
```
❯ lldb
(lldb) script
Python Interactive Interpreter. To exit, type 'quit()', 'exit()' or Ctrl-D.
>>>
```
I send a CTRL-C and nothing happens. The `KeyboardInterrupt` only shows up after I hit enter:
```
(lldb) script
Python Interactive Interpreter. To exit, type 'quit()', 'exit()' or Ctrl-D.
>>>
>>>
KeyboardInterrupt
```
Like you said, that doesn't work on Windows and we don't need that for the statusline so it's not on the critical path of this PR, but I'm curious if you can think of a reason this behaves oddly with the MainLoop implementation.
https://github.com/llvm/llvm-project/pull/134956
More information about the lldb-commits
mailing list