Date: Thu, 7 Apr 2005 14:16:00 GMT From: David Xu <davidxu@FreeBSD.org> To: Perforce Change Reviews <perforce@freebsd.org> Subject: PERFORCE change 74661 for review Message-ID: <200504071416.j37EG0rh049945@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=74661 Change 74661 by davidxu@davidxu_alona on 2005/04/07 14:15:29 call enable_thread_event_reporting in fbsd_thread_activate and call disable_thread_event_reporting in fbsd_thread_deactivate, comment out some old hack. Affected files ... .. //depot/projects/davidxu_thread/src/gnu/usr.bin/gdb/libgdb/fbsd-threads.c#6 edit Differences ... ==== //depot/projects/davidxu_thread/src/gnu/usr.bin/gdb/libgdb/fbsd-threads.c#6 (text+ko) ==== @@ -303,27 +303,6 @@ inferior_ptid = ptid; } -static void -fbsd_thread_activate (void) -{ - fbsd_thread_active = 1; - init_thread_list(); - fbsd_thread_find_new_threads (); - get_current_thread (); -} - -static void -fbsd_thread_deactivate (void) -{ - td_ta_delete_p (thread_agent); - - inferior_ptid = pid_to_ptid (proc_handle.pid); - proc_handle.pid = 0; - fbsd_thread_active = 0; - fbsd_thread_present = 0; - init_thread_list (); -} - static td_err_e enable_thread_event (td_thragent_t *thread_agent, int event, CORE_ADDR *bp) { @@ -360,12 +339,7 @@ /* Set the process wide mask saying which events we're interested in. */ td_event_emptyset (&events); td_event_addset (&events, TD_CREATE); -#if 0 - /* FIXME: kettenis/2000-04-23: The event reporting facility is - broken for TD_DEATH events in glibc 2.1.3, so don't enable it for - now. */ td_event_addset (&events, TD_DEATH); -#endif err = td_ta_set_event_p (thread_agent, &events); if (err != TD_OK) @@ -415,8 +389,32 @@ td_death_bp_addr = 0; } +static void +fbsd_thread_activate (void) +{ + fbsd_thread_active = 1; + init_thread_list(); + fbsd_thread_find_new_threads (); + get_current_thread (); + if (fbsd_thread_core == 0) + enable_thread_event_reporting (); +} static void +fbsd_thread_deactivate (void) +{ + if (fbsd_thread_core == 0) + disable_thread_event_reporting(); + td_ta_delete_p (thread_agent); + + inferior_ptid = pid_to_ptid (proc_handle.pid); + proc_handle.pid = 0; + fbsd_thread_active = 0; + fbsd_thread_present = 0; + init_thread_list (); +} + +static void fbsd_thread_new_objfile (struct objfile *objfile) { td_err_e err; @@ -730,10 +728,12 @@ ret = child_ops.to_wait (ptid, ourstatus); if (GET_PID(ret) >= 0 && ourstatus->kind == TARGET_WAITKIND_STOPPED) { + lwp = get_current_lwp (GET_PID(ret)); + ret = BUILD_LWP(lwp, GET_PID(ret)); if (ourstatus->value.sig == TARGET_SIGNAL_TRAP) - check_event(ptid); - lwp = get_current_lwp (GET_PID(ret)); - ret = thread_from_lwp (BUILD_LWP (lwp, GET_PID (ret))); + check_event(ret); + ret = thread_from_lwp (ret); +#if 0 if (!in_thread_list (ret)) add_thread (ret); /* this is a hack, if an event won't cause gdb to stop, for example, @@ -746,6 +746,7 @@ delete_thread (inferior_ptid); inferior_ptid = ret; } +#endif } return (ret);
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200504071416.j37EG0rh049945>