This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
[patch] Fix extended-remote in gdbserver
- From: Daniel Jacobowitz <drow at false dot org>
- To: gdb-patches at sources dot redhat dot com
- Date: Tue, 23 Mar 2004 16:15:21 -0500
- Subject: [patch] Fix extended-remote in gdbserver
Right now, target extended-remote is prone to crashing gdbserver. We don't
remove the initial thread from the process list... ever. So we keep trying
to send it signals, resume it, et cetera.
Committing to HEAD and GDB 6.1 branch.
--
Daniel Jacobowitz
MontaVista Software Debian GNU/Linux Developer
2004-03-23 Daniel Jacobowitz <drow@mvista.com>
* linux-low.c (linux_wait): Clear all_processes list also.
Index: linux-low.c
===================================================================
RCS file: /cvs/src/src/gdb/gdbserver/linux-low.c,v
retrieving revision 1.31
diff -u -p -r1.31 linux-low.c
--- linux-low.c 12 Mar 2004 20:51:50 -0000 1.31
+++ linux-low.c 23 Mar 2004 20:58:27 -0000
@@ -685,13 +685,17 @@ retry:
fprintf (stderr, "\nChild exited with retcode = %x \n", WEXITSTATUS (w));
*status = 'W';
clear_inferiors ();
+ free (all_processes.head);
+ all_processes.head = all_processes.tail = NULL;
return ((unsigned char) WEXITSTATUS (w));
}
else if (!WIFSTOPPED (w))
{
fprintf (stderr, "\nChild terminated with signal = %x \n", WTERMSIG (w));
- clear_inferiors ();
*status = 'X';
+ clear_inferiors ();
+ free (all_processes.head);
+ all_processes.head = all_processes.tail = NULL;
return ((unsigned char) WTERMSIG (w));
}
}