mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-06-17 16:05:56 +08:00
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:
@ -88,7 +88,7 @@ public:
|
||||
void resume (ptid_t, int, enum gdb_signal) override;
|
||||
void mourn_inferior () override;
|
||||
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;
|
||||
|
||||
void fetch_registers (struct regcache *, int) override;
|
||||
void store_registers (struct regcache *, int) override;
|
||||
@ -1120,7 +1120,7 @@ info_solthreads (const char *args, int from_tty)
|
||||
static int
|
||||
thread_db_find_thread_from_tid (struct thread_info *thread, void *data)
|
||||
{
|
||||
long *tid = (long *) data;
|
||||
ULONGEST *tid = (ULONGEST *) data;
|
||||
|
||||
if (thread->ptid.tid () == *tid)
|
||||
return 1;
|
||||
@ -1129,7 +1129,7 @@ thread_db_find_thread_from_tid (struct thread_info *thread, void *data)
|
||||
}
|
||||
|
||||
ptid_t
|
||||
sol_thread_target::get_ada_task_ptid (long lwp, long thread)
|
||||
sol_thread_target::get_ada_task_ptid (long lwp, ULONGEST thread)
|
||||
{
|
||||
struct thread_info *thread_info =
|
||||
iterate_over_threads (thread_db_find_thread_from_tid, &thread);
|
||||
|
Reference in New Issue
Block a user