This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

gdbserver/win32, fix ctrl-c handling.


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]