Date: Sun, 10 Apr 2005 01:55:30 GMT From: David Xu <davidxu@FreeBSD.org> To: Perforce Change Reviews <perforce@freebsd.org> Subject: PERFORCE change 74821 for review Message-ID: <200504100155.j3A1tU3U097909@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
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; }
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200504100155.j3A1tU3U097909>