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.
This commit is contained in:
Tom Tromey
2021-09-16 13:55:04 -06:00
parent 184ea2f731
commit 96bbe3ef96
9 changed files with 26 additions and 21 deletions

View File

@@ -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);
}