From owner-p4-projects@FreeBSD.ORG Sun Apr 10 23:12:41 2005 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 61A9A16A4D0; Sun, 10 Apr 2005 23:12:41 +0000 (GMT) Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 3AA1316A4CE for ; Sun, 10 Apr 2005 23:12:41 +0000 (GMT) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 1AFA243D2D for ; Sun, 10 Apr 2005 23:12:41 +0000 (GMT) (envelope-from davidxu@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.1/8.13.1) with ESMTP id j3ANCfs3001500 for ; Sun, 10 Apr 2005 23:12:41 GMT (envelope-from davidxu@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.1/8.13.1/Submit) id j3ANCeFR001497 for perforce@freebsd.org; Sun, 10 Apr 2005 23:12:40 GMT (envelope-from davidxu@freebsd.org) Date: Sun, 10 Apr 2005 23:12:40 GMT Message-Id: <200504102312.j3ANCeFR001497@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to davidxu@freebsd.org using -f From: David Xu To: Perforce Change Reviews Subject: PERFORCE change 74893 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 10 Apr 2005 23:12:42 -0000 http://perforce.freebsd.org/chv.cgi?CH=74893 Change 74893 by davidxu@davidxu_tiger on 2005/04/10 23:12:24 Use attach_thread to add a thread. Affected files ... .. //depot/projects/davidxu_thread/src/gnu/usr.bin/gdb/libgdb/fbsd-threads.c#10 edit Differences ... ==== //depot/projects/davidxu_thread/src/gnu/usr.bin/gdb/libgdb/fbsd-threads.c#10 (text+ko) ==== @@ -301,10 +301,8 @@ ptid = thread_from_lwp (tmp, &th, &ti); if (!in_thread_list (ptid)) { -#if 0 attach_thread (ptid, &th, &ti, 1); -#endif - add_thread (ptid); + //add_thread (ptid); } inferior_ptid = ptid; } @@ -322,8 +320,8 @@ /* Set up the breakpoint. */ (*bp) = gdbarch_convert_from_func_ptr_addr (current_gdbarch, - (CORE_ADDR) notify.u.bptaddr, - ¤t_target); + (CORE_ADDR)notify.u.bptaddr, + ¤t_target); create_thread_event_breakpoint ((*bp)); return TD_OK; @@ -652,15 +650,17 @@ td_err_e err; /* Add the thread to GDB's thread list. */ - if (!in_thread_list (ptid)) + if (!in_thread_list (ptid)) { add_thread (ptid); - - if (verbose) - printf_unfiltered ("[New %s]\n", target_pid_to_str (ptid)); + if (verbose) + printf_unfiltered ("[New %s]\n", target_pid_to_str (ptid)); + } if (ti_p->ti_state == TD_THR_UNKNOWN || ti_p->ti_state == TD_THR_ZOMBIE) return; /* A zombie thread -- do not attach. */ + if (! IS_THREAD(ptid)) + return; /* Enable thread event reporting for this thread. */ err = td_thr_event_enable_p (th_p, 1); if (err != TD_OK) @@ -1156,7 +1156,7 @@ ret = td_ta_map_id2thr_p (thread_agent, GET_THREAD(ptid), &th); /* get the address of the variable. */ - ret = td_thr_tls_get_addr_p (&th, (void *) lm, offset, &address); + ret = td_thr_tls_get_addr_p (&th, (void *)lm, offset, &address); if (ret != TD_OK) {