This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH v2] Fix 8.2 regression in gdb.python/py-evthreads.exp w/ gdbserver (PR gdb/23379)
>>>>> "Pedro" == Pedro Alves <palves@redhat.com> writes:
Pedro> * python/py-threadevent.c (get_event_thread): Rename to ...
Pedro> (py_get_event_thread): ... this, make extern, add 'ptid' parameter
I get this warning now:
../../binutils-gdb/gdb/python/py-threadevent.c: In function ‘PyObject* py_get_event_thread(ptid_t)’:
../../binutils-gdb/gdb/python/py-threadevent.c:39:3: warning: ‘pythread’ may be used uninitialized in this function [-Wmaybe-uninitialized]
... which seems legitimate to me:
PyObject *pythread;
if (non_stop)
{
thread_info *thread = find_thread_ptid (ptid);
if (thread != nullptr)
pythread = (PyObject *) thread_to_thread_object (thread);
// ... else pythread is uninitialized ...
}
pythread should be set to nullptr where I stuck the comment (or
initialized to nullptr).
Tom