From owner-p4-projects@FreeBSD.ORG Tue Apr 5 01:27:52 2005 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id C9CED16A4D0; Tue, 5 Apr 2005 01:27:50 +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 7F72A16A4CE for ; Tue, 5 Apr 2005 01:27:50 +0000 (GMT) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 34F4643D48 for ; Tue, 5 Apr 2005 01:27:50 +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 j351RoxC091917 for ; Tue, 5 Apr 2005 01:27:50 GMT (envelope-from davidxu@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.1/8.13.1/Submit) id j351RnY3091914 for perforce@freebsd.org; Tue, 5 Apr 2005 01:27:49 GMT (envelope-from davidxu@freebsd.org) Date: Tue, 5 Apr 2005 01:27:49 GMT Message-Id: <200504050127.j351RnY3091914@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 74484 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: Tue, 05 Apr 2005 01:27:52 -0000 http://perforce.freebsd.org/chv.cgi?CH=74484 Change 74484 by davidxu@davidxu_celeron on 2005/04/05 01:27:47 Export thread address to debugger. Affected files ... .. //depot/projects/davidxu_thread/src/gnu/usr.bin/gdb/libgdb/fbsd-threads.c#3 edit .. //depot/projects/davidxu_thread/src/lib/libthread_db/libpthread_db.c#2 edit .. //depot/projects/davidxu_thread/src/lib/libthread_db/libthr_db.c#3 edit .. //depot/projects/davidxu_thread/src/lib/libthread_db/thread_db.h#2 edit Differences ... ==== //depot/projects/davidxu_thread/src/gnu/usr.bin/gdb/libgdb/fbsd-threads.c#3 (text+ko) ==== @@ -918,13 +918,13 @@ if (ti.ti_lid != 0) { - snprintf (buf, sizeof (buf), "Thread %ld (LWP %d)", - GET_THREAD (ptid), ti.ti_lid); + snprintf (buf, sizeof (buf), "Thread %p (LWP %d)", + th.th_thread, ti.ti_lid); } else { - snprintf (buf, sizeof (buf), "Thread %ld (%s)", - GET_THREAD (ptid), thread_db_state_str (ti.ti_state)); + snprintf (buf, sizeof (buf), "Thread %p (%s)", + th.th_thread, thread_db_state_str (ti.ti_state)); } return buf; ==== //depot/projects/davidxu_thread/src/lib/libthread_db/libpthread_db.c#2 (text+ko) ==== @@ -293,6 +293,7 @@ } th->th_ta = ta; th->th_tid = id; + th->th_thread = pt; return (TD_OK); } @@ -327,6 +328,7 @@ if (th->th_tid == -1) return (TD_MALLOC); pt_unmap_lwp(ta, lwp); + th->th_thread = pt; return (TD_OK); } @@ -371,6 +373,7 @@ while (pt != 0) { th.th_ta = ta; th.th_tid = pt_map_thread(ta, pt, PT_USER); + th.th_thread = pt; /* should we unmap lwp here ? */ if (th.th_tid == -1) return (TD_MALLOC); ==== //depot/projects/davidxu_thread/src/lib/libthread_db/libthr_db.c#3 (text+ko) ==== @@ -296,6 +296,7 @@ } th->th_ta = ta; th->th_tid = id; + th->th_thread = pt; return (TD_OK); } @@ -333,6 +334,7 @@ return (TD_NOTHR); th->th_ta = ta; th->th_tid = pt_map_thread(ta, lwp, pt); + th->th_thread = pt; if (th->th_tid == -1) return (TD_MALLOC); return (TD_OK); @@ -372,6 +374,7 @@ if (tmp_lwp != 0) { th.th_ta = ta; th.th_tid = pt_map_thread(ta, tmp_lwp, pt); + th.th_thread = pt; if (th.th_tid == -1) return (TD_MALLOC); if ((*callback)(&th, cbdata_p)) @@ -518,6 +521,7 @@ info->ti_tid = th->th_tid; info->ti_state = TD_THR_RUN; info->ti_type = TD_THR_SYSTEM; + info->ti_thread = NULL; return (TD_OK); } ret = ps_pread(ta->ph, ta->map[th->th_tid].thr + ta->thread_off_state, @@ -526,6 +530,7 @@ return (P2T(ret)); info->ti_lid = ta->map[th->th_tid].lwp; info->ti_tid = th->th_tid; + info->ti_thread = ta->map[th->th_tid].thr; info->ti_ta_p = th->th_ta; if (state == ta->thread_state_running) info->ti_state = TD_THR_RUN; ==== //depot/projects/davidxu_thread/src/lib/libthread_db/thread_db.h#2 (text+ko) ==== @@ -176,6 +176,7 @@ typedef struct { const td_thragent_t *ti_ta_p; thread_t ti_tid; + psaddr_t ti_thread; td_thr_state_e ti_state; td_thr_type_e ti_type; td_thr_events_t ti_events;