aboutsummaryrefslogtreecommitdiff
path: root/gdb/ravenscar-thread.c
diff options
context:
space:
mode:
authorTom Tromey <tromey@adacore.com>2021-09-17 07:46:03 -0600
committerTom Tromey <tromey@adacore.com>2021-09-23 09:30:54 -0600
commitc80e29dba968beca5eee7210d2030d27fe7790c3 (patch)
treeb6e08f09ecd225efa78aae2c6966994413a21b5e /gdb/ravenscar-thread.c
parent96bbe3ef9653e23a17b2315627e0cab441815f2d (diff)
downloadgdb-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/ravenscar-thread.c')
-rw-r--r--gdb/ravenscar-thread.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/gdb/ravenscar-thread.c b/gdb/ravenscar-thread.c
index 6cc583c..85f934b 100644
--- a/gdb/ravenscar-thread.c
+++ b/gdb/ravenscar-thread.c
@@ -118,7 +118,7 @@ struct ravenscar_thread_target final : public target_ops
std::string pid_to_str (ptid_t) override;
- ptid_t get_ada_task_ptid (long lwp, long thread) override;
+ ptid_t get_ada_task_ptid (long lwp, ULONGEST thread) override;
struct btrace_target_info *enable_btrace (ptid_t ptid,
const struct btrace_config *conf)
@@ -682,7 +682,7 @@ ravenscar_inferior_created (inferior *inf)
}
ptid_t
-ravenscar_thread_target::get_ada_task_ptid (long lwp, long thread)
+ravenscar_thread_target::get_ada_task_ptid (long lwp, ULONGEST thread)
{
return ptid_t (m_base_ptid.pid (), 0, thread);
}