diff options
author | Pedro Alves <palves@redhat.com> | 2008-11-05 21:19:45 +0000 |
---|---|---|
committer | Pedro Alves <palves@redhat.com> | 2008-11-05 21:19:45 +0000 |
commit | 29c87f7ff2089f6ef9a07852e4ed382df5223007 (patch) | |
tree | 1988a9e12ec14d719abddb320ebd967f391ec329 /gdb/remote.c | |
parent | e0ba674611b77dce4d02d6b08e90b10255ec3e2d (diff) | |
download | gdb-29c87f7ff2089f6ef9a07852e4ed382df5223007.zip gdb-29c87f7ff2089f6ef9a07852e4ed382df5223007.tar.gz gdb-29c87f7ff2089f6ef9a07852e4ed382df5223007.tar.bz2 |
* remote.c (notice_new_inferiors): Add a new inferior only when
we're going to add a new thread.
Diffstat (limited to 'gdb/remote.c')
-rw-r--r-- | gdb/remote.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/gdb/remote.c b/gdb/remote.c index f4d6c1f..b36a4b4 100644 --- a/gdb/remote.c +++ b/gdb/remote.c @@ -1127,13 +1127,6 @@ static ptid_t continue_thread; static void notice_new_inferiors (ptid_t currthread) { - /* When connecting to a target remote, or to a target - extended-remote which already was debugging an inferior, we may - not know about it yet. Add it before adding its child thread, so - notifications are emitted in a sensible order. */ - if (!in_inferior_list (ptid_get_pid (currthread))) - add_inferior (ptid_get_pid (currthread)); - /* If this is a new thread, add it to GDB's thread list. If we leave it up to WFI to do this, bad things will happen. */ @@ -1169,6 +1162,13 @@ notice_new_inferiors (ptid_t currthread) return; } + /* When connecting to a target remote, or to a target + extended-remote which already was debugging an inferior, we + may not know about it yet. Add it before adding its child + thread, so notifications are emitted in a sensible order. */ + if (!in_inferior_list (ptid_get_pid (currthread))) + add_inferior (ptid_get_pid (currthread)); + /* This is really a new thread. Add it. */ add_thread (currthread); } |