diff options
author | Tom Tromey <tromey@adacore.com> | 2021-09-16 13:55:04 -0600 |
---|---|---|
committer | Tom Tromey <tromey@adacore.com> | 2021-09-23 09:30:54 -0600 |
commit | 96bbe3ef9653e23a17b2315627e0cab441815f2d (patch) | |
tree | cf9ac694a99f0ae9755d3229767a905476a69c00 /gdb/python/py-infthread.c | |
parent | 184ea2f7316c54dd5e0fa84f1fe07a222e8fb44c (diff) | |
download | binutils-96bbe3ef9653e23a17b2315627e0cab441815f2d.zip binutils-96bbe3ef9653e23a17b2315627e0cab441815f2d.tar.gz binutils-96bbe3ef9653e23a17b2315627e0cab441815f2d.tar.bz2 |
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.
Diffstat (limited to 'gdb/python/py-infthread.c')
-rw-r--r-- | gdb/python/py-infthread.c | 5 |
1 files changed, 3 insertions, 2 deletions
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; |