PERFORCE change 74821 for review
David Xu
davidxu at FreeBSD.org
Sat Apr 9 18:55:32 PDT 2005
http://perforce.freebsd.org/chv.cgi?CH=74821
Change 74821 by davidxu at 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;
}
More information about the p4-projects
mailing list