gdbserver/win32, fix ctrl-c handling.

Pedro Alves pedro@codesourcery.com
Thu Nov 26 22:28:00 GMT 2009


Sometimes, a win32 gdbserver would ignore a ctrl-c, because
this

 remote-utils.c:input_interrupt:

      if (cc != 1 || c != '\003' || current_inferior == NULL)
	{
	  fprintf (stderr, "input_interrupt, count = %d c = %d ('%c')\n",
		   cc, c, c);
	  return;
	}

was being reached with current_inferior == NULL.  current_inferior
ends up set to NULL after a EXIT_THREAD_DEBUG_EVENT event.  Between
a thread exit event and any other event that forced a curren_inferiot
switch, ctrl-c's where ignored.  I've applied this patch to handle it
like linux-low.c does.  When a thread exits, switch to any thread
other thread (always the first in the thread list, just because it's
simple and handy).

-- 
Pedro Alves



More information about the Gdb-patches mailing list