]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
Have gdb.ThreadExitedEvent inherit from gdb.ThreadEvent
authorTom Tromey <tromey@adacore.com>
Wed, 17 Sep 2025 14:49:27 +0000 (08:49 -0600)
committerTom Tromey <tromey@adacore.com>
Thu, 18 Sep 2025 14:07:49 +0000 (08:07 -0600)
The documentation says that ThreadExitedEvent is derived from
ThreadEvent, but the code does not actually implement this.

This patch fixes the problem.  I propose applying this to gdb 17 as
well.

Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=33444
Approved-By: Simon Marchi <simon.marchi@efficios.com>
gdb/python/py-event-types.def
gdb/testsuite/gdb.python/py-thread-exited.py

index 15cd9faae692d8d7400f7d6ccd2d0ae088bc163c..83167f36163c39016bd54ed6e8c6f1f39acab8a7 100644 (file)
@@ -54,7 +54,7 @@ GDB_PY_DEFINE_EVENT_TYPE (new_thread,
 GDB_PY_DEFINE_EVENT_TYPE (thread_exited,
                          "ThreadExitedEvent",
                          "GDB thread exited event object",
-                         event_object_type);
+                         thread_event_object_type);
 
 GDB_PY_DEFINE_EVENT_TYPE (new_inferior,
                          "NewInferiorEvent",
index ef5a2441b8e51e25d559c870bd47a04a4952a246..f725bd585c9dd9c9b21a7c129d854b961a5178d0 100644 (file)
@@ -26,6 +26,8 @@ def thread_exited_handler(event):
     global threadOneExit, threadTwoExit, mainThreadExit
     print("{}".format(event))
     assert isinstance(event, gdb.ThreadExitedEvent)
+    # Also check the inheritance.
+    assert isinstance(event, gdb.ThreadEvent)
     if threadOneExit == "":
         threadOneExit = "event type: thread-exited. global num: {}".format(
             event.inferior_thread.global_num