From owner-p4-projects@FreeBSD.ORG Sun Jul 11 03:52:58 2004 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 8D06C16A4D1; Sun, 11 Jul 2004 03:52:57 +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 6773616A4CF for ; Sun, 11 Jul 2004 03:52:57 +0000 (GMT) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 4881C43D1D for ; Sun, 11 Jul 2004 03:52:57 +0000 (GMT) (envelope-from davidxu@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.12.11/8.12.11) with ESMTP id i6B3qvEt055734 for ; Sun, 11 Jul 2004 03:52:57 GMT (envelope-from davidxu@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.12.11/8.12.11/Submit) id i6B3qukI055731 for perforce@freebsd.org; Sun, 11 Jul 2004 03:52:56 GMT (envelope-from davidxu@freebsd.org) Date: Sun, 11 Jul 2004 03:52:56 GMT Message-Id: <200407110352.i6B3qukI055731@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 57038 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: Sun, 11 Jul 2004 03:52:58 -0000 http://perforce.freebsd.org/chv.cgi?CH=57038 Change 57038 by davidxu@davidxu_alona on 2004/07/11 03:52:28 use ps_lstop, ps_lcontinue to stop/resume bound thread, however signal thread won't be stopped. Affected files ... .. //depot/projects/davidxu_ksedbg/src/lib/libthread_db/pthread/pthread_db.c#7 edit .. //depot/projects/davidxu_ksedbg/src/lib/libthread_db/pthread/pthread_db.h#2 edit Differences ... ==== //depot/projects/davidxu_ksedbg/src/lib/libthread_db/pthread/pthread_db.c#7 (text+ko) ==== @@ -444,6 +444,8 @@ { struct pthread pt; pt_thragent_t *ta = (pt_thragent_t *)th->th_ta_p; + psaddr_t tcb_addr; + uint32_t dflags; int ret; TDBG_FUNC(); @@ -468,12 +470,15 @@ return (P2T(ret)); if (pt.magic != THR_MAGIC) return (TD_BADTH); + tcb_addr = (psaddr_t) pt.tcb; ret = ps_pdread(ta->ph, - ((psaddr_t)pt.tcb) + offsetof(struct tcb, tcb_tmbx.tm_lwp), + tcb_addr + offsetof(struct tcb, tcb_tmbx.tm_lwp), &info->ti_lid, sizeof(lwpid_t)); if (ret != 0) return (P2T(ret)); - + ret = ps_pdread(ta->ph, + tcb_addr + offsetof(struct tcb, tcb_tmbx.tm_dflags), + &dflags, sizeof(dflags)); info->ti_ta_p = th->th_ta_p; info->ti_tid = th->th_unique; info->ti_tls = (char *)pt.specific; @@ -503,7 +508,7 @@ break; } - info->ti_db_suspended = 0; + info->ti_db_suspended = ((dflags & TMDF_DONOTRUNUSER) != 0); info->ti_type = TD_THR_USER; info->ti_pri = pt.active_priority; info->ti_sigmask = pt.sigmask; @@ -815,14 +820,10 @@ return (ret); if (ta->map[th->th_unique].type == PT_LWP) { -#if 0 if (suspend) ret = ps_lstop(ta->ph, ta->map[th->th_unique].lwp); else ret = ps_lcontinue(ta->ph, ta->map[th->th_unique].lwp); -#else - ret = 0; -#endif return (P2T(ret)); } @@ -841,15 +842,18 @@ ret = ps_pdread(ta->ph, ptr, &lwp, sizeof(lwpid_t)); if (ret != 0) return (P2T(ret)); + /* + * don't stop lwp assigned to a M:N thread, it belongs + * to UTS, UTS shouldn't be stopped. + */ if (lwp != 0 && (attrflags & PTHREAD_SCOPE_SYSTEM)) { -#if 0 + /* dont' suspend signal thread */ + if (attrflags & THR_SIGNAL_THREAD) + return 0; if (suspend) ret = ps_lstop(ta->ph, lwp); else ret = ps_lcontinue(ta->ph, lwp); -#else - ret = 0; -#endif return (P2T(ret)); } ==== //depot/projects/davidxu_ksedbg/src/lib/libthread_db/pthread/pthread_db.h#2 (text+ko) ====