aboutsummaryrefslogtreecommitdiff
path: root/gdb/python/py-evts.c
diff options
context:
space:
mode:
authorTom Tromey <tromey@redhat.com>2013-05-20 20:36:19 +0000
committerTom Tromey <tromey@redhat.com>2013-05-20 20:36:19 +0000
commitaa36459a9256a0e74bba08842e9ff6d10cab543d (patch)
tree2393980a5d2b05ecf06120d8d07786dc2dacc344 /gdb/python/py-evts.c
parent3d4a3c3ea2536c69a01c8c13b851784aa1b5d956 (diff)
downloadgdb-aa36459a9256a0e74bba08842e9ff6d10cab543d.zip
gdb-aa36459a9256a0e74bba08842e9ff6d10cab543d.tar.gz
gdb-aa36459a9256a0e74bba08842e9ff6d10cab543d.tar.bz2
* python/py-arch.c (gdbpy_initialize_arch): Use
gdb_pymodule_addobject. * python/py-block.c (gdbpy_initialize_blocks): Use gdb_pymodule_addobject. * python/py-breakpoint.c (gdbpy_initialize_breakpoints): Use gdb_pymodule_addobject. * python/py-cmd.c (gdbpy_initialize_breakpoints): Use gdb_pymodule_addobject. * python/py-event.c (gdbpy_initialize_event_generic): Use gdb_pymodule_addobject. * python/py-evtregistry.c (gdbpy_initialize_eventregistry): Use gdb_pymodule_addobject. * python/py-evts.c (add_new_registry): Use gdb_pymodule_addobject. (gdbpy_initialize_py_events): Likewise. * python/py-finishbreakpoint.c (gdbpy_initialize_finishbreakpoints): Use gdb_pymodule_addobject. * python/py-frame.c (gdbpy_initialize_frames): Use gdb_pymodule_addobject. * python/py-function.c (gdbpy_initialize_functions): Use gdb_pymodule_addobject. * python/py-inferior.c (gdbpy_initialize_inferior): Use gdb_pymodule_addobject. * python/py-infthread.c (gdbpy_initialize_thread): Use gdb_pymodule_addobject. * python/py-objfile.c (gdbpy_initialize_objfile): Use gdb_pymodule_addobject. * python/py-param.c (gdbpy_initialize_parameters): Use gdb_pymodule_addobject. * python/py-progspace.c (gdbpy_initialize_pspace): Use gdb_pymodule_addobject. * python/py-symbol.c (gdbpy_initialize_symbols): Use gdb_pymodule_addobject. * python/py-symtab.c (gdbpy_initialize_symtabs): Use gdb_pymodule_addobject. * python/py-type.c (gdbpy_initialize_types): Use gdb_pymodule_addobject. * python/py-utils.c (gdb_pymodule_addobject): New function. * python/py-value.c (gdbpy_initialize_values): Use gdb_pymodule_addobject. * python/python-internal.h (gdb_pymodule_addobject): Declare. * python/python.c (_initialize_python): Use gdb_pymodule_addobject.
Diffstat (limited to 'gdb/python/py-evts.c')
-rw-r--r--gdb/python/py-evts.c23
1 files changed, 9 insertions, 14 deletions
diff --git a/gdb/python/py-evts.c b/gdb/python/py-evts.c
index 4828bda..971c520 100644
--- a/gdb/python/py-evts.c
+++ b/gdb/python/py-evts.c
@@ -40,21 +40,16 @@ static struct PyModuleDef EventModuleDef =
static int CPYCHECKER_NEGATIVE_RESULT_SETS_EXCEPTION
add_new_registry (eventregistry_object **registryp, char *name)
{
+ int result;
+
*registryp = create_eventregistry_object ();
if (*registryp == NULL)
- goto fail;
-
- if (PyModule_AddObject (gdb_py_events.module,
- name,
- (PyObject *)(*registryp)) < 0)
- goto fail;
-
- return 0;
+ return -1;
- fail:
- Py_XDECREF (*registryp);
- return -1;
+ return gdb_pymodule_addobject (gdb_py_events.module,
+ name,
+ (PyObject *)(*registryp));
}
int
@@ -81,9 +76,9 @@ gdbpy_initialize_py_events (void)
if (add_new_registry (&gdb_py_events.new_objfile, "new_objfile") < 0)
return -1;
- if (PyModule_AddObject (gdb_module,
- "events",
- (PyObject *) gdb_py_events.module) < 0)
+ if (gdb_pymodule_addobject (gdb_module,
+ "events",
+ (PyObject *) gdb_py_events.module) < 0)
return -1;
return 0;