aboutsummaryrefslogtreecommitdiff
path: root/gdb/linux-nat.c
diff options
context:
space:
mode:
Diffstat (limited to 'gdb/linux-nat.c')
-rw-r--r--gdb/linux-nat.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/gdb/linux-nat.c b/gdb/linux-nat.c
index 126f7dc..fe78c25 100644
--- a/gdb/linux-nat.c
+++ b/gdb/linux-nat.c
@@ -2719,14 +2719,13 @@ linux_nat_wait (ptid_t ptid, struct target_waitstatus *ourstatus)
{
gdb_assert (!is_lwp (inferior_ptid));
- inferior_ptid = BUILD_LWP (GET_PID (inferior_ptid),
- GET_PID (inferior_ptid));
+ /* Upgrade the main thread's ptid. */
+ thread_change_ptid (inferior_ptid,
+ BUILD_LWP (GET_PID (inferior_ptid),
+ GET_PID (inferior_ptid)));
+
lp = add_lwp (inferior_ptid);
lp->resumed = 1;
- /* Add the main thread to GDB's thread list. */
- add_thread_silent (lp->ptid);
- set_running (lp->ptid, 1);
- set_executing (lp->ptid, 1);
}
/* Block events while we're here. */