diff options
author | marius <marius@FreeBSD.org> | 2011-08-06 17:48:30 +0000 |
---|---|---|
committer | marius <marius@FreeBSD.org> | 2011-08-06 17:48:30 +0000 |
commit | c027f659aec89f64db78bfcc9d1f69960b2ba7df (patch) | |
tree | 1860b6ab82e70d8cefa1483208425059c5b44969 | |
parent | 7da5e4e4a0b7b587332818426cff89a656b21259 (diff) | |
download | FreeBSD-src-c027f659aec89f64db78bfcc9d1f69960b2ba7df.zip FreeBSD-src-c027f659aec89f64db78bfcc9d1f69960b2ba7df.tar.gz |
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
Approved by: re (kib)
MFC after: 1 week
-rw-r--r-- | lib/libthread_db/libthr_db.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/lib/libthread_db/libthr_db.c b/lib/libthread_db/libthr_db.c index 33225f4..65248c1 100644 --- a/lib/libthread_db/libthr_db.c +++ b/lib/libthread_db/libthr_db.c @@ -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; + long lwp; int ret; TDBG_FUNC(); @@ -214,7 +214,7 @@ pt_ta_map_id2thr(const td_thragent_t *ta, thread_t id, td_thrhandle_t *th) 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_thr_iter_f *callback, { td_thrhandle_t th; psaddr_t pt; - int32_t lwp; + long lwp; int ret; TDBG_FUNC(); @@ -254,7 +254,7 @@ pt_ta_thr_iter(const td_thragent_t *ta, td_thr_iter_f *callback, 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 *ta, td_event_msg_t *msg) psaddr_t pt; td_thr_events_e tmp; - int32_t lwp; + long lwp; int ret; TDBG_FUNC(); @@ -395,7 +395,7 @@ pt_ta_event_getmsg(const td_thragent_t *ta, td_event_msg_t *msg) 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; @@ -672,7 +672,7 @@ pt_thr_event_getmsg(const td_thrhandle_t *th, td_event_msg_t *msg) static td_thrhandle_t handle; const td_thragent_t *ta = th->th_ta; psaddr_t pt, pt_temp; - int32_t lwp; + long lwp; int ret; td_thr_events_e tmp; @@ -699,7 +699,7 @@ pt_thr_event_getmsg(const td_thrhandle_t *th, td_event_msg_t *msg) 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; |