diff options
author | marcel <marcel@FreeBSD.org> | 2008-09-14 16:52:42 +0000 |
---|---|---|
committer | marcel <marcel@FreeBSD.org> | 2008-09-14 16:52:42 +0000 |
commit | cdbf12a91a9b3ee26919dc8cc87b7ce2ee7a6fb5 (patch) | |
tree | 1cbde5082b3d497ca06f3a07472572a62798fd11 | |
parent | b934eafe5ec762456704ad6aa2df68ebb8f9d18c (diff) | |
download | FreeBSD-src-cdbf12a91a9b3ee26919dc8cc87b7ce2ee7a6fb5.zip FreeBSD-src-cdbf12a91a9b3ee26919dc8cc87b7ce2ee7a6fb5.tar.gz |
Widen psaddr_t from uintptr_t to uint64_t. This results in an
ABI change on ILP32 platforms and relating to events. However
it's harmless on little-endian ILP32 platforms in the sense
that it doesn't cause breakages. Old ILP32 thread libraries
write a 32-bit th_p and new thread libraries write a 64-bit
th_p. But due to the fact that we have an unused 32-bit data
field right after th_p and that field is always initialized to
zero, little-endian ILP32 machines effectively have a valid
64-bit th_p by accident. Likewise for new thread libraries and
old libthread_db: little endian ILP32 is unaffected.
At this time we don't support big-endian threaded applications
in GDB, so the breakage for the ILP32 case goes unnoticed.
-rw-r--r-- | gnu/usr.bin/gdb/libgdb/fbsd-threads.c | 13 | ||||
-rw-r--r-- | sys/sys/procfs.h | 2 |
2 files changed, 8 insertions, 7 deletions
diff --git a/gnu/usr.bin/gdb/libgdb/fbsd-threads.c b/gnu/usr.bin/gdb/libgdb/fbsd-threads.c index 730d0f6..eb83f2e 100644 --- a/gnu/usr.bin/gdb/libgdb/fbsd-threads.c +++ b/gnu/usr.bin/gdb/libgdb/fbsd-threads.c @@ -710,7 +710,7 @@ check_event (ptid_t ptid) error ("Cannot get thread event message: %s", thread_db_err_str (err)); } - err = td_thr_get_info_p (msg.th_p, &ti); + err = td_thr_get_info_p ((void *)(uintptr_t)msg.th_p, &ti); if (err != TD_OK) error ("Cannot get thread info: %s", thread_db_err_str (err)); ptid = BUILD_THREAD (ti.ti_tid, GET_PID (ptid)); @@ -720,7 +720,7 @@ check_event (ptid_t ptid) /* We may already know about this thread, for instance when the user has issued the `info threads' command before the SIGTRAP for hitting the thread creation breakpoint was reported. */ - attach_thread (ptid, msg.th_p, &ti, 1); + attach_thread (ptid, (void *)(uintptr_t)msg.th_p, &ti, 1); break; case TD_DEATH: if (!in_thread_list (ptid)) @@ -1178,13 +1178,14 @@ fbsd_thread_pid_to_str (ptid_t ptid) if (ti.ti_lid != 0) { - snprintf (buf, sizeof (buf), "Thread %p (LWP %d)", - th.th_thread, ti.ti_lid); + snprintf (buf, sizeof (buf), "Thread %llx (LWP %d)", + (unsigned long long)th.th_thread, ti.ti_lid); } else { - snprintf (buf, sizeof (buf), "Thread %p (%s)", - th.th_thread, thread_db_state_str (ti.ti_state)); + snprintf (buf, sizeof (buf), "Thread %llx (%s)", + (unsigned long long)th.th_thread, + thread_db_state_str (ti.ti_state)); } return buf; diff --git a/sys/sys/procfs.h b/sys/sys/procfs.h index 7acfd57..a8d862e 100644 --- a/sys/sys/procfs.h +++ b/sys/sys/procfs.h @@ -80,6 +80,6 @@ typedef struct prpsinfo { char pr_psargs[PRARGSZ+1]; /* Arguments, null terminated (1) */ } prpsinfo_t; -typedef uintptr_t psaddr_t; /* An address in the target process. */ +typedef uint64_t psaddr_t; /* An address in the target process. */ #endif /* _SYS_PROCFS_H_ */ |