From owner-p4-projects@FreeBSD.ORG Sun Apr 10 01:55:32 2005 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 73ADC16A4D0; Sun, 10 Apr 2005 01:55:31 +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 4B4E216A4CE for ; Sun, 10 Apr 2005 01:55:31 +0000 (GMT) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 2DED343D2D for ; Sun, 10 Apr 2005 01:55:31 +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 j3A1tVUt097912 for ; Sun, 10 Apr 2005 01:55:31 GMT (envelope-from davidxu@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.1/8.13.1/Submit) id j3A1tU3U097909 for perforce@freebsd.org; Sun, 10 Apr 2005 01:55:30 GMT (envelope-from davidxu@freebsd.org) Date: Sun, 10 Apr 2005 01:55:30 GMT Message-Id: <200504100155.j3A1tU3U097909@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 74821 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 01:55:32 -0000 http://perforce.freebsd.org/chv.cgi?CH=74821 Change 74821 by davidxu@davidxu_tiger on 2005/04/10 01:55:29 Use attach_thread to add new thread, this enables us to to enable event reporting for existing each thread. Affected files ... .. //depot/projects/davidxu_thread/src/gnu/usr.bin/gdb/libgdb/fbsd-threads.c#8 edit Differences ... ==== //depot/projects/davidxu_thread/src/gnu/usr.bin/gdb/libgdb/fbsd-threads.c#8 (text+ko) ==== @@ -394,10 +394,10 @@ { fbsd_thread_active = 1; init_thread_list(); + if (fbsd_thread_core == 0) + enable_thread_event_reporting (); fbsd_thread_find_new_threads (); get_current_thread (); - if (fbsd_thread_core == 0) - enable_thread_event_reporting (); } static void @@ -646,7 +646,8 @@ td_err_e err; /* Add the thread to GDB's thread list. */ - add_thread (ptid); + if (!in_thread_list (ptid)) + add_thread (ptid); if (verbose) printf_unfiltered ("[New %s]\n", target_pid_to_str (ptid)); @@ -703,8 +704,7 @@ /* We may already know about this thread, for instance when the user has issued the `info threads' command before the SIGTRAP for hitting the thread creation breakpoint was reported. */ - if (!in_thread_list (ptid)) - attach_thread (ptid, msg.th_p, &ti, 1); + attach_thread (ptid, msg.th_p, &ti, 1); break; case TD_DEATH: if (!in_thread_list (ptid)) @@ -1051,9 +1051,7 @@ return 0; ptid = BUILD_THREAD (ti.ti_tid, proc_handle.pid); - - if (!in_thread_list (ptid)) - add_thread (ptid); + attach_thread (ptid, th_p, &ti, 1); return 0; }