From 0a9db5ad8a6c49cec7adb7e3ef29c558fcfbf11b Mon Sep 17 00:00:00 2001 From: Tom Tromey Date: Wed, 12 Sep 2018 23:06:09 -0600 Subject: Change objfile_to_objfile_object to return a new reference This changes objfile_to_objfile_object to return a new references and fixes up all the uses. gdb/ChangeLog 2018-09-16 Tom Tromey * python/py-progspace.c (pspy_get_objfiles): Update. * python/python-internal.h (objfile_to_objfile_object): Change return type. * python/py-newobjfileevent.c (create_new_objfile_event_object): Update. * python/py-xmethods.c (gdbpy_get_matching_xmethod_workers): Update. * python/python.c (gdbpy_get_current_objfile): Update. (gdbpy_objfiles): Update. * python/py-objfile.c (objfpy_get_owner, gdbpy_lookup_objfile): Update. (objfile_to_objfile_object): Return a new reference. * python/py-symtab.c (stpy_get_objfile): Update. * python/py-prettyprint.c (find_pretty_printer_from_objfiles): Update. --- gdb/python/python.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) (limited to 'gdb/python/python.c') diff --git a/gdb/python/python.c b/gdb/python/python.c index 66b6631..1a0562a 100644 --- a/gdb/python/python.c +++ b/gdb/python/python.c @@ -1359,15 +1359,10 @@ gdbpy_execute_objfile_script (const struct extension_language_defn *extlang, static PyObject * gdbpy_get_current_objfile (PyObject *unused1, PyObject *unused2) { - PyObject *result; - if (! gdbpy_current_objfile) Py_RETURN_NONE; - result = objfile_to_objfile_object (gdbpy_current_objfile); - if (result) - Py_INCREF (result); - return result; + return objfile_to_objfile_object (gdbpy_current_objfile).release (); } /* Compute the list of active python type printers and store them in -- cgit v1.1