diff options
author | Tom Tromey <tromey@adacore.com> | 2021-09-17 07:46:03 -0600 |
---|---|---|
committer | Tom Tromey <tromey@adacore.com> | 2021-09-23 09:30:54 -0600 |
commit | c80e29dba968beca5eee7210d2030d27fe7790c3 (patch) | |
tree | b6e08f09ecd225efa78aae2c6966994413a21b5e /gdb/target.c | |
parent | 96bbe3ef9653e23a17b2315627e0cab441815f2d (diff) | |
download | gdb-c80e29dba968beca5eee7210d2030d27fe7790c3.zip gdb-c80e29dba968beca5eee7210d2030d27fe7790c3.tar.gz gdb-c80e29dba968beca5eee7210d2030d27fe7790c3.tar.bz2 |
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>
Diffstat (limited to 'gdb/target.c')
-rw-r--r-- | gdb/target.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/gdb/target.c b/gdb/target.c index d1c1bf5..2cb587d 100644 --- a/gdb/target.c +++ b/gdb/target.c @@ -67,7 +67,7 @@ static int default_region_ok_for_hw_watchpoint (struct target_ops *, static void default_rcmd (struct target_ops *, const char *, struct ui_file *); static ptid_t default_get_ada_task_ptid (struct target_ops *self, - long lwp, long tid); + long lwp, ULONGEST tid); static void default_mourn_inferior (struct target_ops *self); @@ -595,7 +595,7 @@ target_can_execute_reverse () } ptid_t -target_get_ada_task_ptid (long lwp, long tid) +target_get_ada_task_ptid (long lwp, ULONGEST tid) { return current_inferior ()->top_target ()->get_ada_task_ptid (lwp, tid); } @@ -1133,7 +1133,7 @@ default_terminal_info (struct target_ops *self, const char *args, int from_tty) inferior_ptid. */ static ptid_t -default_get_ada_task_ptid (struct target_ops *self, long lwp, long tid) +default_get_ada_task_ptid (struct target_ops *self, long lwp, ULONGEST tid) { return ptid_t (inferior_ptid.pid (), lwp, tid); } |