From c80e29dba968beca5eee7210d2030d27fe7790c3 Mon Sep 17 00:00:00 2001 From: Tom Tromey Date: Fri, 17 Sep 2021 07:46:03 -0600 Subject: 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 --- gdb/target.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'gdb/target.h') diff --git a/gdb/target.h b/gdb/target.h index 57afebe..61febdb 100644 --- a/gdb/target.h +++ b/gdb/target.h @@ -856,7 +856,7 @@ struct target_ops based on LWP and THREAD. These values are extracted from the task Private_Data section of the Ada Task Control Block, and their interpretation depends on the target. */ - virtual ptid_t get_ada_task_ptid (long lwp, long thread) + virtual ptid_t get_ada_task_ptid (long lwp, ULONGEST thread) TARGET_DEFAULT_FUNC (default_get_ada_task_ptid); /* Read one auxv entry from *READPTR, not reading locations >= ENDPTR. @@ -2141,7 +2141,7 @@ extern bool target_can_execute_reverse (); extern const struct target_desc *target_read_description (struct target_ops *); -extern ptid_t target_get_ada_task_ptid (long lwp, long tid); +extern ptid_t target_get_ada_task_ptid (long lwp, ULONGEST tid); /* Main entry point for searching memory. */ extern int target_search_memory (CORE_ADDR start_addr, -- cgit v1.1