Small event ownership clean up in Python layer
authorTom Tromey <tom@tromey.com>
Fri, 8 Sep 2017 20:26:43 +0000 (14:26 -0600)
committerTom Tromey <tom@tromey.com>
Mon, 11 Sep 2017 20:15:21 +0000 (14:15 -0600)
commit35c61a1dd5462ceab42618c48c9a60238245761b
treed74d1822708779e9d19ed23b5b2bc6c5917289e2
parent7c96f8c1dae023c7d0b1cabc5e50c4d18fd06960
Small event ownership clean up in Python layer

It seems cleaner to me for functions like create_thread_event_object,
which pass object ownership to their callers, to directly return a
gdb_ref<>.  This way the ownership transfer is part of the API.  This
patch makes this change.

ChangeLog
2017-09-11  Tom Tromey  <tom@tromey.com>

* python/py-threadevent.c (create_thread_event_object): Return
gdbpy_ref.
* python/py-stopevent.h (create_stop_event_object)
(create_breakpoint_event_object, create_signal_event_object):
Update.
* python/py-stopevent.c (create_stop_event_object): Return
gdbpy_ref.
(emit_stop_event): Update.
* python/py-signalevent.c (create_signal_event_object): Return
gdbpy_ref.
* python/py-infevents.c (create_inferior_call_event_object):
Update.
* python/py-event.h (create_event_object)
(create_thread_event_object): Update.
* python/py-event.c (create_event_object): Return gdbpy_ref.
* python/py-continueevent.c: Return gdbpy_ref.
* python/py-bpevent.c (create_breakpoint_event_object): Return
gdbpy_ref.
gdb/ChangeLog
gdb/python/py-bpevent.c
gdb/python/py-continueevent.c
gdb/python/py-event.c
gdb/python/py-event.h
gdb/python/py-infevents.c
gdb/python/py-signalevent.c
gdb/python/py-stopevent.c
gdb/python/py-stopevent.h
gdb/python/py-threadevent.c