PERFORCE change 74893 for review
David Xu
davidxu at FreeBSD.org
Sun Apr 10 16:12:42 PDT 2005
http://perforce.freebsd.org/chv.cgi?CH=74893
Change 74893 by davidxu at 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)
{
More information about the p4-projects
mailing list