binutils-gdb/gdb/python
Tom Tromey 7c96f8c1da Add new_inferior, inferior_deleted, and new_thread events
This adds a few new events to gdb's Python layer: new_inferior,
inferior_deleted, and new_thread.  I wanted to be able to add a
combined inferior/thread display window to my GUI, and I needed a few
events to make this work.  This is PR python/15622.

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

	PR python/15622:
	* NEWS: Add entry.
	* python/python.c (do_start_initialization): Initialize new event
	types.
	* python/python-internal.h (gdbpy_initialize_new_inferior_event)
	(gdbpy_initialize_inferior_deleted_event)
	(gdbpy_initialize_new_thread_event): Declare.
	* python/py-threadevent.c (create_thread_event_object): Add option
	"thread" parameter.
	* python/py-inferior.c (new_thread_event_object_type)
	(new_inferior_event_object_type)
	(inferior_deleted_event_object_type): Declare.
	(python_new_inferior, python_inferior_deleted): New functions.
	(add_thread_object): Emit new_thread event.
	(gdbpy_initialize_inferior): Attach new functions to corresponding
	observers.
	(new_thread, new_inferior, inferior_deleted): Define new event
	types.
	* python/py-evts.c (gdbpy_initialize_py_events): Add new
	registries.
	* python/py-events.h (events_object) <new_inferior,
	inferior_deleted, new_thread>: New fields.
	* python/py-event.h (create_thread_event_breakpoint): Add optional
	"thread" parameter.

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

	* python.texi (Events In Python): Document new events.

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

	* gdb.python/py-infthread.exp: Add tests for new_thread event.
	* gdb.python/py-inferior.exp: Add tests for new inferior events.
2017-09-11 14:15:20 -06:00
..
lib/gdb Import sys in gdb/python/lib/gdb/printer/bound_registers.py 2017-03-22 11:22:07 +00:00
py-arch.c -Wwrite-strings: Add a PyArg_ParseTupleAndKeywords "const char *" overload 2017-04-05 19:21:36 +01:00
py-auto-load.c
py-block.c -Wwrite-strings: Wrap PyGetSetDef for construction with string literals 2017-04-05 19:21:36 +01:00
py-bpevent.c Turn gdbpy_ref into a template 2017-02-10 12:24:31 -07:00
py-breakpoint.c Avoid some manual memory management in Python 2017-08-03 07:59:07 -06:00
py-cmd.c Introduce gdb_argv, a class wrapper for buildargv 2017-08-03 07:59:08 -06:00
py-continueevent.c Turn gdbpy_ref into a template 2017-02-10 12:24:31 -07:00
py-event.c -Wwrite-strings: The Rest 2017-04-05 19:21:37 +01:00
py-event.h Add new_inferior, inferior_deleted, and new_thread events 2017-09-11 14:15:20 -06:00
py-events.h Add new_inferior, inferior_deleted, and new_thread events 2017-09-11 14:15:20 -06:00
py-evtregistry.c Use gdbpy_ref to simplify some logic 2017-02-10 12:24:32 -07:00
py-evts.c Add new_inferior, inferior_deleted, and new_thread events 2017-09-11 14:15:20 -06:00
py-exitedevent.c Turn gdbpy_ref into a template 2017-02-10 12:24:31 -07:00
py-finishbreakpoint.c Introduce event_location_up 2017-04-12 11:16:17 -06:00
py-frame.c Kill init_sal 2017-09-04 17:11:45 +01:00
py-framefilter.c -Wwrite-strings: The Rest 2017-04-05 19:21:37 +01:00
py-function.c Turn gdbpy_ref into a template 2017-02-10 12:24:31 -07:00
py-gdb-readline.c Fix python-interactive with Python 3.6 2017-01-20 20:39:08 -05:00
py-inferior.c Add new_inferior, inferior_deleted, and new_thread events 2017-09-11 14:15:20 -06:00
py-infevents.c Turn gdbpy_ref into a template 2017-02-10 12:24:31 -07:00
py-infthread.c -Wwrite-strings: Wrap PyGetSetDef for construction with string literals 2017-04-05 19:21:36 +01:00
py-instruction.c Python: Introduce gdb.Instruction class 2017-05-02 11:35:54 +02:00
py-instruction.h Python: Introduce gdb.Instruction class 2017-05-02 11:35:54 +02:00
py-lazy-string.c -Wwrite-strings: Wrap PyGetSetDef for construction with string literals 2017-04-05 19:21:36 +01:00
py-linetable.c Change find_pcs_for_symtab_line to return a std::vector 2017-04-12 11:16:17 -06:00
py-newobjfileevent.c Turn gdbpy_ref into a template 2017-02-10 12:24:31 -07:00
py-objfile.c -Wwrite-strings: Add a PyArg_ParseTupleAndKeywords "const char *" overload 2017-04-05 19:21:36 +01:00
py-param.c Use gdb_argv in Python 2017-08-03 07:59:09 -06:00
py-prettyprint.c Change one more spot to use gdbpy_ref 2017-02-10 12:24:33 -07:00
py-progspace.c -Wwrite-strings: Wrap PyGetSetDef for construction with string literals 2017-04-05 19:21:36 +01:00
py-record-btrace.c btrace: Store btrace_insn in an std::vector 2017-09-04 10:46:36 +02:00
py-record-btrace.h Python: Move and rename gdb.BtraceFunction 2017-05-02 11:35:54 +02:00
py-record-full.c python: Implement btrace Python bindings for record history. 2017-02-14 10:57:56 +01:00
py-record-full.h python: Implement btrace Python bindings for record history. 2017-02-14 10:57:56 +01:00
py-record.c Python: Introduce gdb.Instruction class 2017-05-02 11:35:54 +02:00
py-record.h Python: Move and rename gdb.BtraceFunction 2017-05-02 11:35:54 +02:00
py-ref.h Turn gdbpy_ref into a template 2017-02-10 12:24:31 -07:00
py-signalevent.c Turn gdbpy_ref into a template 2017-02-10 12:24:31 -07:00
py-stopevent.c Turn gdbpy_ref into a template 2017-02-10 12:24:31 -07:00
py-stopevent.h
py-symbol.c -Wwrite-strings: Add a PyArg_ParseTupleAndKeywords "const char *" overload 2017-04-05 19:21:36 +01:00
py-symtab.c -Wwrite-strings: Wrap PyGetSetDef for construction with string literals 2017-04-05 19:21:36 +01:00
py-threadevent.c Add new_inferior, inferior_deleted, and new_thread events 2017-09-11 14:15:20 -06:00
py-type.c Make cp_comp_to_string return a gdb::unique_xmalloc_ptr<char> 2017-08-09 15:04:32 +01:00
py-unwind.c Fix Python unwinder frames regression 2017-07-06 00:19:24 +01:00
py-utils.c Turn gdbpy_ref into a template 2017-02-10 12:24:31 -07:00
py-value.c Stop assuming no-debug-info functions return int 2017-09-04 20:21:13 +01:00
py-varobj.c Avoid some manual memory management in Python 2017-08-03 07:59:07 -06:00
py-xmethods.c Support rvalue references in the gdb python module (includes doc/) 2017-03-20 13:47:52 -07:00
python-config.py
python-internal.h Add new_inferior, inferior_deleted, and new_thread events 2017-09-11 14:15:20 -06:00
python.c Add new_inferior, inferior_deleted, and new_thread events 2017-09-11 14:15:20 -06:00
python.h