summaryrefslogtreecommitdiff
path: root/gdb/linux-nat.c
diff options
context:
space:
mode:
authorPedro Alves <pedro@codesourcery.com>2008-09-08 21:22:48 +0000
committerPedro Alves <pedro@codesourcery.com>2008-09-08 21:22:48 +0000
commit957e114ba3c9e9586e6dcfbf76a1a93605a4c368 (patch)
tree3e543a4ae2953ef45d5de52bf809d16b464607a0 /gdb/linux-nat.c
parent6c408e200cb2586bf640e7c8fc73afee2d586a8a (diff)
downloadgdb-957e114ba3c9e9586e6dcfbf76a1a93605a4c368.tar.gz
* linux-nat.c (linux_nat_wait): Update inferior_ptid's ptid with
thread_change_ptid. Don't add or mark the main thread as running and executing here. * fork-child.c (fork_inferior): Add the main thread here.
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 126f7dcb781..fe78c258bdb 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. */