Re: PATCH: Use getche on Win32

Mark Mitchell
2005-05-13T06:29:38Z

Eli Zaretskii wrote:
>>Date: Tue, 10 May 2005 23:54:46 -0700
>>From: Mark Mitchell <mark@codesourcery.com>
>>CC: Eli Zaretskii <eliz@gnu.org>, bug-readline@gnu.org,
>> gdb-patches@sources.redhat.com
>>
>>As Daniel says, the Ctrl-C issue is independent of this code, and, as
>>Chris says, it's perfectly possible to capture Ctrl-C under Windows; we
>>just don't want to do it here.
>
>
> In the last sentence, what does ``here'' mean? Do you mean you don't
> want to do it in Readline? If so, I think it's a mistake: the Unix
> code of Readline clearly does manipulate signals, and I think a
> Windows port should be as close to it as it can.

You are of course correct that readline manipulates signals. In
particular, it registers signal handlers at the start of the function
named readline, and then removes them before returning. It would indeed
be desirable that the Windows version behave as much like POSIX as
possible in this respect.

However, when you said earlier that handling Ctrl-C was very important
to GDB, Daniel and I understood you to be referring to the ability to
interrupt the inferior when readline is not active. In other words,
after you say "run", you may want to hit Ctrl-C before you reach a
breakpoint. That functionality is independent of readline; it comes
from signal handlers that GDB itself installs.

So, what I wrote is way too strong a statement. I should have just said
that handling Ctrl-C here is not as critical as elsewhere. I also can't
find any suggestion that readline actually reads the "Ctrl" and "C"
characters through its main input loop; instead, I think that it just
installs signal handlers in the usual way. It's possible that I've just
not find the right bit yet, though.

Thanks,

--
Mark Mitchell
CodeSourcery, LLC
mark@codesourcery.com
(916) 791-8304