From: Pedro Alves Date: Fri, 12 Dec 2008 01:08:29 +0000 (+0000) Subject: * remote.c (remote_detach_1): Don't delete the inferior here. X-Git-Url: http://drtracing.org/?a=commitdiff_plain;h=5f3563ea7a07d0c74d23f6c56281fb27dfc514d8;hp=ca19bf23094735e554d7101913b42a2d71fce1e5;p=deliverable%2Fbinutils-gdb.git * remote.c (remote_detach_1): Don't delete the inferior here. (process_stop_reply): Ditto. (extended_remote_kill): Ditto. --- diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 88289006cf..33a32b653f 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,9 @@ +2008-12-12 Pedro Alves + + * remote.c (remote_detach_1): Don't delete the inferior here. + (process_stop_reply): Ditto. + (extended_remote_kill): Ditto. + 2008-12-12 Pedro Alves * remote.c (read_ptid): If we don't know about any inferior yet, diff --git a/gdb/remote.c b/gdb/remote.c index 9af9efea18..81eef47eaf 100644 --- a/gdb/remote.c +++ b/gdb/remote.c @@ -3316,7 +3316,6 @@ remote_detach_1 (char *args, int from_tty, int extended) } discard_pending_stop_replies (pid); - detach_inferior (pid); target_mourn_inferior (); } @@ -4510,32 +4509,29 @@ process_stop_reply (struct stop_reply *stop_reply, 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; } @@ -6509,7 +6505,6 @@ extended_remote_kill (void) if (res != 0) error (_("Can't kill process")); - delete_inferior (pid); target_mourn_inferior (); }