]> git.ipfire.org Git - thirdparty/binutils-gdb.git/blobdiff - gdb/python/py-evts.c
Update copyright year range in all GDB files.
[thirdparty/binutils-gdb.git] / gdb / python / py-evts.c
index de0f2b454dc7fa88be185f69106c9e27f62f479e..76d67efb07ef1348c7b5a9f1c4ea8d32330bf14e 100644 (file)
@@ -1,6 +1,6 @@
 /* Python interface to inferior events.
 
-   Copyright (C) 2009-2015 Free Software Foundation, Inc.
+   Copyright (C) 2009-2020 Free Software Foundation, Inc.
 
    This file is part of GDB.
 
@@ -38,10 +38,8 @@ static struct PyModuleDef EventModuleDef =
 /* Initialize python events.  */
 
 static int CPYCHECKER_NEGATIVE_RESULT_SETS_EXCEPTION
-add_new_registry (eventregistry_object **registryp, char *name)
+add_new_registry (eventregistry_object **registryp, const char *name)
 {
-  int result;
-
   *registryp = create_eventregistry_object ();
 
   if (*registryp == NULL)
@@ -64,32 +62,11 @@ gdbpy_initialize_py_events (void)
   if (!gdb_py_events.module)
     return -1;
 
-  if (add_new_registry (&gdb_py_events.stop, "stop") < 0)
-    return -1;
-
-  if (add_new_registry (&gdb_py_events.cont, "cont") < 0)
-    return -1;
-
-  if (add_new_registry (&gdb_py_events.exited, "exited") < 0)
-    return -1;
-
-  if (add_new_registry (&gdb_py_events.inferior_call,
-                       "inferior_call") < 0)
-    return -1;
-
-  if (add_new_registry (&gdb_py_events.memory_changed,
-                       "memory_changed") < 0)
-    return -1;
-
-  if (add_new_registry (&gdb_py_events.register_changed,
-                       "register_changed") < 0)
-    return -1;
-
-  if (add_new_registry (&gdb_py_events.new_objfile, "new_objfile") < 0)
-    return -1;
-
-  if (add_new_registry (&gdb_py_events.clear_objfiles, "clear_objfiles") < 0)
+#define GDB_PY_DEFINE_EVENT(name)                              \
+  if (add_new_registry (&gdb_py_events.name, #name) < 0)       \
     return -1;
+#include "py-all-events.def"
+#undef GDB_PY_DEFINE_EVENT
 
   if (gdb_pymodule_addobject (gdb_module,
                              "events",