From 3c7aa30778a1615d88c13508c04138ef2499112d Mon Sep 17 00:00:00 2001 From: Tom Tromey Date: Wed, 12 Sep 2018 21:44:19 -0600 Subject: Change pspace_to_pspace_object to return a new reference This changes pspace_to_pspace_object to return a new reference and fixes up all the callers. gdb/ChangeLog 2018-09-16 Tom Tromey * python/py-inferior.c (infpy_get_progspace): Update. * python/python-internal.h (pspace_to_pspace_object): Change return type. * python/py-newobjfileevent.c (create_clear_objfiles_event_object): Update. * python/py-xmethods.c (gdbpy_get_matching_xmethod_workers): Update. * python/python.c (gdbpy_get_current_progspace): Update. (gdbpy_progspaces): Update. * python/py-progspace.c (pspace_to_pspace_object): Return a new reference. * python/py-objfile.c (objfpy_get_progspace): Update. * python/py-prettyprint.c (find_pretty_printer_from_progspace): Update. --- gdb/python/py-xmethods.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'gdb/python/py-xmethods.c') diff --git a/gdb/python/py-xmethods.c b/gdb/python/py-xmethods.c index f7e3c37..c568295 100644 --- a/gdb/python/py-xmethods.c +++ b/gdb/python/py-xmethods.c @@ -122,7 +122,6 @@ gdbpy_get_matching_xmethod_workers std::vector *dm_vec) { struct objfile *objfile; - PyObject *py_progspace; gdb_assert (obj_type != NULL && method_name != NULL); @@ -170,10 +169,11 @@ gdbpy_get_matching_xmethod_workers /* Gather debug methods matchers registered with the current program space. */ - py_progspace = pspace_to_pspace_object (current_program_space); + gdbpy_ref<> py_progspace = pspace_to_pspace_object (current_program_space); if (py_progspace != NULL) { - gdbpy_ref<> pspace_matchers (pspy_get_xmethods (py_progspace, NULL)); + gdbpy_ref<> pspace_matchers (pspy_get_xmethods (py_progspace.get (), + NULL)); gdbpy_ref<> temp (PySequence_Concat (py_xmethod_matcher_list.get (), pspace_matchers.get ())); -- cgit v1.1