diff options
-rw-r--r-- | gdb/python/py-inferior.c | 3 | ||||
-rw-r--r-- | gdb/testsuite/gdb.python/py-infthread.exp | 3 |
2 files changed, 4 insertions, 2 deletions
diff --git a/gdb/python/py-inferior.c b/gdb/python/py-inferior.c index 6b1443d..45e33f9 100644 --- a/gdb/python/py-inferior.c +++ b/gdb/python/py-inferior.c @@ -333,7 +333,8 @@ add_thread_object (struct thread_info *tp) return; gdbpy_ref<> event = create_thread_event_object (&new_thread_event_object_type, - (PyObject *) inf_obj); + (PyObject *) + entry->thread_obj.get ()); if (event == NULL || evpy_emit_event (event.get (), gdb_py_events.new_thread) < 0) gdbpy_print_stack (); diff --git a/gdb/testsuite/gdb.python/py-infthread.exp b/gdb/testsuite/gdb.python/py-infthread.exp index b074715..5cbbe43 100644 --- a/gdb/testsuite/gdb.python/py-infthread.exp +++ b/gdb/testsuite/gdb.python/py-infthread.exp @@ -31,7 +31,8 @@ gdb_test_multiline "install new_thread event handler" \ "python" "" \ "seen_a_thread = False" "" \ "def thread_handler(evt):" "" \ - " if evt.inferior_thread is not None:" "" \ + " if (evt.inferior_thread is not None" "" \ + " and isinstance (evt.inferior_thread, gdb.InferiorThread)):" "" \ " global seen_a_thread" "" \ " seen_a_thread = True" "" \ "gdb.events.new_thread.connect(thread_handler)" "" \ |