+2008-12-12 Pedro Alves <pedro@codesourcery.com>
+
+ * remote.c (remote_detach_1): Don't delete the inferior here.
+ (process_stop_reply): Ditto.
+ (extended_remote_kill): Ditto.
+
2008-12-12 Pedro Alves <pedro@codesourcery.com>
* remote.c (read_ptid): If we don't know about any inferior yet,
}
discard_pending_stop_replies (pid);
- detach_inferior (pid);
target_mourn_inferior ();
}
if (ptid_equal (ptid, null_ptid))
ptid = inferior_ptid;
- if (status->kind == TARGET_WAITKIND_EXITED
- || status->kind == TARGET_WAITKIND_SIGNALLED)
+ if (status->kind != TARGET_WAITKIND_EXITED
+ && status->kind != TARGET_WAITKIND_SIGNALLED)
{
- int pid = ptid_get_pid (ptid);
- delete_inferior (pid);
- }
- else
- notice_new_inferiors (ptid);
+ notice_new_inferiors (ptid);
- /* Expedited registers. */
- if (stop_reply->regcache)
- {
- cached_reg_t *reg;
- int ix;
+ /* Expedited registers. */
+ if (stop_reply->regcache)
+ {
+ cached_reg_t *reg;
+ int ix;
+
+ for (ix = 0;
+ VEC_iterate(cached_reg_t, stop_reply->regcache, ix, reg);
+ ix++)
+ regcache_raw_supply (get_thread_regcache (ptid),
+ reg->num, reg->data);
+ VEC_free (cached_reg_t, stop_reply->regcache);
+ }
- for (ix = 0;
- VEC_iterate(cached_reg_t, stop_reply->regcache, ix, reg);
- ix++)
- regcache_raw_supply (get_thread_regcache (ptid),
- reg->num, reg->data);
- VEC_free (cached_reg_t, stop_reply->regcache);
+ remote_stopped_by_watchpoint_p = stop_reply->stopped_by_watchpoint_p;
+ remote_watch_data_address = stop_reply->watch_data_address;
}
- remote_stopped_by_watchpoint_p = stop_reply->stopped_by_watchpoint_p;
- remote_watch_data_address = stop_reply->watch_data_address;
-
stop_reply_xfree (stop_reply);
return ptid;
}
if (res != 0)
error (_("Can't kill process"));
- delete_inferior (pid);
target_mourn_inferior ();
}