This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [RFA] fix crasher on detach command
Pedro Alves wrote:
To be a bit clearer --
you've said that the pid was left as 42000 (I assume you meant
inferior_ptid, but that find_inferior no longer finds that inferior.
Where is the current inferior getting it's pid cleared out? Why
aren't we clearing inferior_ptid as well?
OK, right.
remote_close calls discard_all_inferiors -- it should also
set inferior_ptid to null_ptid at the same time.
How's this patch?
2010-06-07 Michael Snyder <msnyder@vmware.com>
* remote.c (remote_close): Set inferior_ptid to null_ptid.
Index: remote.c
===================================================================
RCS file: /cvs/src/src/gdb/remote.c,v
retrieving revision 1.415
diff -u -p -r1.415 remote.c
--- remote.c 2 Jun 2010 22:21:53 -0000 1.415
+++ remote.c 8 Jun 2010 00:08:57 -0000
@@ -2811,6 +2811,7 @@ remote_close (int quitting)
/* We don't have a connection to the remote stub anymore. Get rid
of all the inferiors and their threads we were controlling. */
discard_all_inferiors ();
+ inferior_ptid = null_ptid;
/* We're no longer interested in any of these events. */
discard_pending_stop_replies (-1);