diff options
author | Tom Tromey <tom@tromey.com> | 2018-09-12 21:44:19 -0600 |
---|---|---|
committer | Tom Tromey <tom@tromey.com> | 2018-09-16 07:25:56 -0600 |
commit | 3c7aa30778a1615d88c13508c04138ef2499112d (patch) | |
tree | cdfc313d4149467e51b5495cd1e41a416b9653be /gdb/python/py-newobjfileevent.c | |
parent | 8743a9cdd20055e02a20c24c37b5312e3e626691 (diff) | |
download | binutils-3c7aa30778a1615d88c13508c04138ef2499112d.zip binutils-3c7aa30778a1615d88c13508c04138ef2499112d.tar.gz binutils-3c7aa30778a1615d88c13508c04138ef2499112d.tar.bz2 |
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 <tom@tromey.com>
* 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.
Diffstat (limited to 'gdb/python/py-newobjfileevent.c')
-rw-r--r-- | gdb/python/py-newobjfileevent.c | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/gdb/python/py-newobjfileevent.c b/gdb/python/py-newobjfileevent.c index a9341a3..aa31fb4 100644 --- a/gdb/python/py-newobjfileevent.c +++ b/gdb/python/py-newobjfileevent.c @@ -66,12 +66,10 @@ create_clear_objfiles_event_object (void) if (objfile_event == NULL) return NULL; - /* Note that pspace_to_pspace_object returns a borrowed reference, - so we don't need a decref here. */ - PyObject *py_progspace = pspace_to_pspace_object (current_program_space); - if (!py_progspace || evpy_add_attribute (objfile_event.get (), - "progspace", - py_progspace) < 0) + gdbpy_ref<> py_progspace = pspace_to_pspace_object (current_program_space); + if (py_progspace == NULL || evpy_add_attribute (objfile_event.get (), + "progspace", + py_progspace.get ()) < 0) return NULL; return objfile_event; |