[0/3] Fix Windows C-c handling

Message ID 20221205185651.2704492-1-tromey@adacore.com
Headers
Series Fix Windows C-c handling |

Message

Tom Tromey Dec. 5, 2022, 6:56 p.m. UTC
  This series attempts to fix C-c handling on Windows, which was broken
by target async.

I ran this series through the AdaCore test suite (I've never managed
to run dejagnu on Windows), but of course that doesn't really test
this area much, or else we would have seen a regression from target
async.

I also tested this by starting an RDP session (avoiding whatever
cygwin/mingw issue affects C-c handling for me normally) and trying
"run", "attach", and "run"-with-new-console; and exercising both C-c
and C-break.

Let me know what you think.

Tom
  

Comments

Tom Tromey Dec. 5, 2022, 6:59 p.m. UTC | #1
Tom> This series attempts to fix C-c handling on Windows, which was broken
Tom> by target async.

Jon, would you mind testing this on Cygwin?  I can't really do that, but
I'd rather not break the build again.

The branch is in my github as 'submit/windows-c-c', which may be more
convenient than applying via email.

thanks,
Tom
  
Jon Turney Dec. 12, 2022, 1:23 p.m. UTC | #2
On 05/12/2022 18:59, Tom Tromey wrote:
> Tom> This series attempts to fix C-c handling on Windows, which was broken
> Tom> by target async.
> 
> Jon, would you mind testing this on Cygwin?  I can't really do that, but
> I'd rather not break the build again.
> 
> The branch is in my github as 'submit/windows-c-c', which may be more
> convenient than applying via email.

Thanks.

This compiles ok, and seems to work.

I'm sure how, since my theory was that Cygwin should continue to use 
GenerateConsoleCtrlEvent() on the inferior, which would then experience 
a SIGINT in the Cygwin runtime, and gdb gets told about that emulated 
signal and stops the inferior.

(In practice, I don't think that reliably worked before, and I have 
precisely zero time to look into this currently, so go ahead...)
  
Tom Tromey Dec. 12, 2022, 5:29 p.m. UTC | #3
>>>>> "Jon" == Jon Turney <jon.turney@dronecode.org.uk> writes:

Jon> On 05/12/2022 18:59, Tom Tromey wrote:
Tom> This series attempts to fix C-c handling on Windows, which was broken
Tom> by target async.
>> Jon, would you mind testing this on Cygwin?  I can't really do that,
>> but
>> I'd rather not break the build again.
>> The branch is in my github as 'submit/windows-c-c', which may be
>> more
>> convenient than applying via email.

Jon> Thanks.

Jon> This compiles ok, and seems to work.

Thanks for trying it.

Jon> I'm sure how, since my theory was that Cygwin should continue to use
Jon> GenerateConsoleCtrlEvent() on the inferior, which would then
Jon> experience a SIGINT in the Cygwin runtime, and gdb gets told about
Jon> that emulated signal and stops the inferior.

Jon> (In practice, I don't think that reliably worked before, and I have
Jon> precisely zero time to look into this currently, so go ahead...)

I don't know either :)  If it works for you then that seems pretty good;
and we can always change the Cygwin code paths later if need be.

Tom