From owner-p4-projects@FreeBSD.ORG Sun Jun 13 05:57:08 2004 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id CA95416A4D1; Sun, 13 Jun 2004 05:57:07 +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 A4A8316A4CE for ; Sun, 13 Jun 2004 05:57:07 +0000 (GMT) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 9E56843D2F for ; Sun, 13 Jun 2004 05:57:07 +0000 (GMT) (envelope-from marcel@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 i5D5thrq033741 for ; Sun, 13 Jun 2004 05:55:43 GMT (envelope-from marcel@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.12.11/8.12.11/Submit) id i5D5tgsl033738 for perforce@freebsd.org; Sun, 13 Jun 2004 05:55:42 GMT (envelope-from marcel@freebsd.org) Date: Sun, 13 Jun 2004 05:55:42 GMT Message-Id: <200406130555.i5D5tgsl033738@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to marcel@freebsd.org using -f From: Marcel Moolenaar To: Perforce Change Reviews Subject: PERFORCE change 54791 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, 13 Jun 2004 05:57:08 -0000 http://perforce.freebsd.org/chv.cgi?CH=54791 Change 54791 by marcel@marcel_nfs on 2004/06/13 05:54:59 o Add kdb_thr_ctx(), which given a struct thread returns the threads context (=PCB). Affected files ... .. //depot/projects/gdb/sys/kern/subr_kdb.c#15 edit .. //depot/projects/gdb/sys/sys/kdb.h#12 edit Differences ... ==== //depot/projects/gdb/sys/kern/subr_kdb.c#15 (text+ko) ==== @@ -277,6 +277,12 @@ * Thread related support functions. */ +struct pcb * +kdb_thr_ctx(struct thread *thr) +{ + return ((thr == curthread) ? &kdb_pcb : thr->td_pcb); +} + struct thread * kdb_thr_first(void) { @@ -329,7 +335,7 @@ if (thr == NULL) return (EINVAL); kdb_thread = thr; - kdb_thrctx = (thr == curthread) ? &kdb_pcb : thr->td_pcb; + kdb_thrctx = kdb_thr_ctx(thr); return (0); } ==== //depot/projects/gdb/sys/sys/kdb.h#12 (text+ko) ==== @@ -68,6 +68,7 @@ void kdb_init(void); void * kdb_jmpbuf(jmp_buf); void kdb_reenter(void); +struct pcb *kdb_thr_ctx(struct thread *); struct thread *kdb_thr_first(void); struct thread *kdb_thr_lookup(pid_t); struct thread *kdb_thr_next(struct thread *);