From 96bbe3ef9653e23a17b2315627e0cab441815f2d Mon Sep 17 00:00:00 2001 From: Tom Tromey Date: Thu, 16 Sep 2021 13:55:04 -0600 Subject: Change ptid_t::tid to ULONGEST The ptid_t 'tid' member is normally used as an address in gdb -- both bsd-uthread and ravenscar-thread use it this way. However, because the type is 'long', this can cause problems with sign extension. This patch changes the type to ULONGEST to ensure that sign extension does not occur. --- gdb/python/py-infthread.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'gdb/python') diff --git a/gdb/python/py-infthread.c b/gdb/python/py-infthread.c index 5645442..74bbe99 100644 --- a/gdb/python/py-infthread.c +++ b/gdb/python/py-infthread.c @@ -296,7 +296,8 @@ PyObject * gdbpy_create_ptid_object (ptid_t ptid) { int pid; - long tid, lwp; + long lwp; + ULONGEST tid; PyObject *ret; ret = PyTuple_New (3); @@ -313,7 +314,7 @@ gdbpy_create_ptid_object (ptid_t ptid) gdbpy_ref<> lwp_obj = gdb_py_object_from_longest (lwp); if (lwp_obj == nullptr) return nullptr; - gdbpy_ref<> tid_obj = gdb_py_object_from_longest (tid); + gdbpy_ref<> tid_obj = gdb_py_object_from_ulongest (tid); if (tid_obj == nullptr) return nullptr; -- cgit v1.1