/* Python interface to inferior events.
- Copyright (C) 2009-2013 Free Software Foundation, Inc.
+ Copyright (C) 2009-2019 Free Software Foundation, Inc.
This file is part of GDB.
/* 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)
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.new_objfile, "new_objfile") < 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",