Tom Tromey
2010-12-14 21:37:58 UTC
This fix comes from the trunk.
Without this we will crash when calling gdb.selected_thread before any
threads exist.
Ok to push?
Tom
@@ -206,6 +294,9 @@ find_thread_object (ptid_t ptid)
PyObject *inf_obj;
pid = PIDGET (ptid);
+ if (pid == 0)
+ return NULL;
+
inf_obj = find_inferior_object (pid);
if (inf_obj)
Without this we will crash when calling gdb.selected_thread before any
threads exist.
Ok to push?
Tom
@@ -206,6 +294,9 @@ find_thread_object (ptid_t ptid)
PyObject *inf_obj;
pid = PIDGET (ptid);
+ if (pid == 0)
+ return NULL;
+
inf_obj = find_inferior_object (pid);
if (inf_obj)