From owner-p4-projects@FreeBSD.ORG Thu Apr 7 14:16:01 2005 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 5CAC116A4D0; Thu, 7 Apr 2005 14:16:01 +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 2C25316A4CE for ; Thu, 7 Apr 2005 14:16:01 +0000 (GMT) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id E2E8A43D1F for ; Thu, 7 Apr 2005 14:16:00 +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 j37EG0IW049948 for ; Thu, 7 Apr 2005 14:16:00 GMT (envelope-from davidxu@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.1/8.13.1/Submit) id j37EG0rh049945 for perforce@freebsd.org; Thu, 7 Apr 2005 14:16:00 GMT (envelope-from davidxu@freebsd.org) Date: Thu, 7 Apr 2005 14:16:00 GMT Message-Id: <200504071416.j37EG0rh049945@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 74661 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: Thu, 07 Apr 2005 14:16:02 -0000 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);