diff options
author | Tom Tromey <tromey@adacore.com> | 2022-12-05 10:56:23 -0700 |
---|---|---|
committer | Tom Tromey <tromey@adacore.com> | 2022-12-13 12:51:53 -0700 |
commit | c88afe9cf5d7fb0bd878acb930d79aafcf182505 (patch) | |
tree | aa074a83270492bc86695706e82b322d67ab34b8 /binutils/rddbg.c | |
parent | c1dc47f53cccf633f3079db25a5b41adaee940a8 (diff) | |
download | gdb-c88afe9cf5d7fb0bd878acb930d79aafcf182505.zip gdb-c88afe9cf5d7fb0bd878acb930d79aafcf182505.tar.gz gdb-c88afe9cf5d7fb0bd878acb930d79aafcf182505.tar.bz2 |
Fix control-c handling on Windows
As Hannes pointed out, the Windows target-async patches broke C-c
handling there. Looking into this, I found a few oddities, fixed
here.
First, windows_nat_target::interrupt calls GenerateConsoleCtrlEvent.
I think this event can be ignored by the inferior, so it's not a great
way to interrupt. Instead, using DebugBreakProcess (or a more
complicated thing for Wow64) seems better.
Second, windows_nat_target did not implement the pass_ctrlc method.
Implementing this lets us remove the special code to call
SetConsoleCtrlHandler and instead integrate into gdb's approach to C-c
handling. I believe that this should also fix the race that's
described in the comment that's being removed.
Initially, I thought a simpler version of this patch would work.
However, I think what happens is that some other library (I'm not sure
what) calls SetConsoleCtrlHandler while gdb is running, and this
intercepts and handles C-c -- so that the gdb SIGINT handler is not
called. C-break continues to work, presumably because whatever
handler is installed ignores it.
This patch works around this issue by ensuring that the gdb handler
always comes first.
Diffstat (limited to 'binutils/rddbg.c')
0 files changed, 0 insertions, 0 deletions