aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Tromey <tromey@adacore.com>2021-09-16 13:55:04 -0600
committerTom Tromey <tromey@adacore.com>2021-09-23 09:30:54 -0600
commit96bbe3ef9653e23a17b2315627e0cab441815f2d (patch)
treecf9ac694a99f0ae9755d3229767a905476a69c00 /gdb/bsd-uthread.c
parentRemove defaulted 'tid' parameter to ptid_t constructor (diff)
downloadbinutils-gdb-96bbe3ef9653e23a17b2315627e0cab441815f2d.tar.gz
binutils-gdb-96bbe3ef9653e23a17b2315627e0cab441815f2d.tar.bz2
binutils-gdb-96bbe3ef9653e23a17b2315627e0cab441815f2d.zip
Change ptid_t::tid to ULONGEST
The ptid_t 'tid' member is normally used as an address in gdb -- both bsd-uthread and ravenscar-thread use it this way. However, because the type is 'long', this can cause problems with sign extension. This patch changes the type to ULONGEST to ensure that sign extension does not occur.
Diffstat (limited to 'gdb/bsd-uthread.c')
-rw-r--r--gdb/bsd-uthread.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/gdb/bsd-uthread.c b/gdb/bsd-uthread.c
index f8353f07041..1e594983bcd 100644
--- a/gdb/bsd-uthread.c
+++ b/gdb/bsd-uthread.c
@@ -538,8 +538,9 @@ std::string
bsd_uthread_target::pid_to_str (ptid_t ptid)
{
if (ptid.tid () != 0)
- return string_printf ("process %d, thread 0x%lx",
- ptid.pid (), ptid.tid ());
+ return string_printf ("process %d, thread 0x%s",
+ ptid.pid (),
+ phex_nz (ptid.tid (), sizeof (ULONGEST)));
return normal_pid_to_str (ptid);
}