svn commit: r224825 - stable/7/lib/libthread_db
Marius Strobl
marius at FreeBSD.org
Sat Aug 13 12:47:11 UTC 2011
Author: marius
Date: Sat Aug 13 12:47:10 2011
New Revision: 224825
URL: http://svn.freebsd.org/changeset/base/224825
Log:
MFC: r224683, r224693
The tid member of struct pthread actually is long so read it as such.
Accessing it as an int causes failure on big-endian LP64, i.e. mips64be,
powerpc64 and sparc64.
Reviewed by: marcel
Modified:
stable/7/lib/libthread_db/libthr_db.c
Directory Properties:
stable/7/lib/libthread_db/ (props changed)
Modified: stable/7/lib/libthread_db/libthr_db.c
==============================================================================
--- stable/7/lib/libthread_db/libthr_db.c Sat Aug 13 12:47:09 2011 (r224824)
+++ stable/7/lib/libthread_db/libthr_db.c Sat Aug 13 12:47:10 2011 (r224825)
@@ -202,7 +202,7 @@ static td_err_e
pt_ta_map_id2thr(const td_thragent_t *ta, thread_t id, td_thrhandle_t *th)
{
psaddr_t pt;
- int32_t lwp;
+ int64_t lwp;
int ret;
TDBG_FUNC();
@@ -214,7 +214,7 @@ pt_ta_map_id2thr(const td_thragent_t *ta
return (TD_ERR);
/* Iterate through thread list to find pthread */
while (pt != 0) {
- ret = thr_pread_int(ta, pt + ta->thread_off_tid, &lwp);
+ ret = thr_pread_long(ta, pt + ta->thread_off_tid, &lwp);
if (ret != 0)
return (TD_ERR);
if (lwp == id)
@@ -245,7 +245,7 @@ pt_ta_thr_iter(const td_thragent_t *ta,
{
td_thrhandle_t th;
psaddr_t pt;
- int32_t lwp;
+ int64_t lwp;
int ret;
TDBG_FUNC();
@@ -254,7 +254,7 @@ pt_ta_thr_iter(const td_thragent_t *ta,
if (ret != 0)
return (TD_ERR);
while (pt != 0) {
- ret = thr_pread_int(ta, pt + ta->thread_off_tid, &lwp);
+ ret = thr_pread_long(ta, pt + ta->thread_off_tid, &lwp);
if (ret != 0)
return (TD_ERR);
if (lwp != 0 && lwp != TERMINATED) {
@@ -368,7 +368,7 @@ pt_ta_event_getmsg(const td_thragent_t *
psaddr_t pt;
td_thr_events_e tmp;
- int32_t lwp;
+ int64_t lwp;
int ret;
TDBG_FUNC();
@@ -395,7 +395,7 @@ pt_ta_event_getmsg(const td_thragent_t *
ps_pwrite(ta->ph, pt + ta->thread_off_event_buf, &tmp, sizeof(tmp));
/* Convert event */
pt = msg->th_p;
- ret = thr_pread_int(ta, pt + ta->thread_off_tid, &lwp);
+ ret = thr_pread_long(ta, pt + ta->thread_off_tid, &lwp);
if (ret != 0)
return (TD_ERR);
handle.th_ta = ta;
@@ -651,7 +651,7 @@ pt_thr_event_getmsg(const td_thrhandle_t
static td_thrhandle_t handle;
const td_thragent_t *ta = th->th_ta;
psaddr_t pt, pt_temp;
- int32_t lwp;
+ int64_t lwp;
int ret;
td_thr_events_e tmp;
@@ -678,7 +678,7 @@ pt_thr_event_getmsg(const td_thrhandle_t
ps_pwrite(ta->ph, pt + ta->thread_off_event_buf, &tmp, sizeof(tmp));
/* Convert event */
pt = msg->th_p;
- ret = thr_pread_int(ta, pt + ta->thread_off_tid, &lwp);
+ ret = thr_pread_long(ta, pt + ta->thread_off_tid, &lwp);
if (ret != 0)
return (TD_ERR);
handle.th_ta = ta;
More information about the svn-src-all
mailing list