Commit 9c3059c3 authored by Eric Pouech's avatar Eric Pouech Committed by Alexandre Julliard

Added ctrl-c support.

parent 1d86056a
...@@ -932,6 +932,19 @@ void DEBUG_Run(const char* args) ...@@ -932,6 +932,19 @@ void DEBUG_Run(const char* args)
} }
} }
static BOOL WINAPI DEBUG_CtrlCHandler(DWORD dwCtrlType)
{
if (dwCtrlType == CTRL_C_EVENT)
{
DEBUG_Printf(DBG_CHN_MESG, "Ctrl-C: stopping debuggee\n");
/* FIXME: since we likely have a single process, signal the first process
* in list
*/
return DEBUG_ProcessList && DebugBreakProcess(DEBUG_ProcessList->handle);
}
return FALSE;
}
static void DEBUG_InitConsole(void) static void DEBUG_InitConsole(void)
{ {
COORD c; COORD c;
...@@ -962,6 +975,9 @@ static void DEBUG_InitConsole(void) ...@@ -962,6 +975,9 @@ static void DEBUG_InitConsole(void)
/* put the line editing mode with the nice emacs features (FIXME: could be triggered by a IVAR) */ /* put the line editing mode with the nice emacs features (FIXME: could be triggered by a IVAR) */
if (GetConsoleMode(GetStdHandle(STD_INPUT_HANDLE), &mode)) if (GetConsoleMode(GetStdHandle(STD_INPUT_HANDLE), &mode))
SetConsoleMode(GetStdHandle(STD_INPUT_HANDLE), mode | WINE_ENABLE_LINE_INPUT_EMACS); SetConsoleMode(GetStdHandle(STD_INPUT_HANDLE), mode | WINE_ENABLE_LINE_INPUT_EMACS);
/* set our control-C handler */
SetConsoleCtrlHandler(DEBUG_CtrlCHandler, TRUE);
} }
int main(int argc, char** argv) int main(int argc, char** argv)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment