Change get_ada_task_ptid parameter type

get_ada_task_ptid currently takes a 'long' as its 'thread' parameter
type.  However, on some platforms this is actually a pointer, and
using 'long' can sometimes end up with the value being sign-extended.
This sign extension can cause problems later, if the tid is then later
used as an address again.

This patch changes the parameter type to ULONGEST and updates all the
uses.  This approach preserves sign extension on the targets where it
is apparently intended, while avoiding it on others.

Co-Authored-By: John Baldwin <jhb@FreeBSD.org>
This commit is contained in:
Tom Tromey 2021-09-17 07:46:03 -06:00
parent 96bbe3ef96
commit c80e29dba9
13 changed files with 29 additions and 29 deletions

View file

@ -144,7 +144,7 @@ public:
const char *extra_thread_info (struct thread_info *) override;
ptid_t get_ada_task_ptid (long lwp, long thread) override;
ptid_t get_ada_task_ptid (long lwp, ULONGEST thread) override;
};
static aix_thread_target aix_thread_ops;
@ -1825,7 +1825,7 @@ aix_thread_target::extra_thread_info (struct thread_info *thread)
}
ptid_t
aix_thread_target::get_ada_task_ptid (long lwp, long thread)
aix_thread_target::get_ada_task_ptid (long lwp, ULONGEST thread)
{
return ptid_t (inferior_ptid.pid (), 0, thread);
}