Commit Graph

2 Commits

Author SHA1 Message Date
Simon Marchi
2554f6f564 gdb: give names to event loop file handlers
Assign names to event loop file handlers.  They will be used in debug
messages when file handlers are invoked.

In GDB, each UI used to get its own unique number, until commit
cbe256847e ("Remove ui::num").  Re-introduce this field, and use it to
make a unique name for the handler.

I'm not too sure what goes on in ser-base.c, all I know is that it's
what is used when debugging remotely.  I've just named the main handler
"serial".  It would be good to have unique names there too.  For instance
when debugging with two different remote connections, we'd ideally want
the handlers to have unique names.  I didn't do it in this patch though.

gdb/ChangeLog:

	* async-event.c (initialize_async_signal_handlers): Pass name to
	add_file_handler
	* event-top.c (ui_register_input_event_handler): Likewise.
	* linux-nat.c (linux_nat_target::async): Likewise.
	* run-on-main-thread.c (_initialize_run_on_main_thread):
	Likewise
	* ser-base.c (reschedule): Likewise.
	(ser_base_async): Likewise.
	* tui/tui-io.c: Likewise.
	* top.h (struct ui) <num>: New field.
	* top.c (highest_ui_num): New variable.
	(ui::ui): Initialize num.

gdbserver/ChangeLog:

	* linux-low.cc (linux_process_target::async): Pass name to
	add_file_handler.
	* remote-utils.cc (handle_accept_event): Likewise.
	(remote_open): Likewise.

gdbsupport/ChangeLog:

	* event-loop.h (add_file_handler): Add "name" parameter.
	* event-loop.cc (struct file_handler) <name>: New field.
	(create_file_handler): Add "name" parameter, assign it to file
	handler.
	(add_file_handler): Add "name" parameter.

Change-Id: I9f1545f73888ebb6778eb653a618ca44d105f92c
2020-10-02 14:46:56 -04:00
Tom Tromey
400b5eca00 Move event-loop.[ch] to gdbsupport/
This moves event-loop.[ch] to gdbsupport/ and updates the uses in gdb.

gdb/ChangeLog
2020-04-13  Tom Tromey  <tom@tromey.com>

	* run-on-main-thread.c: Update include.
	* unittests/main-thread-selftests.c: Update include.
	* tui/tui-win.c: Update include.
	* tui/tui-io.c: Update include.
	* tui/tui-interp.c: Update include.
	* tui/tui-hooks.c: Update include.
	* top.h: Update include.
	* top.c: Update include.
	* ser-base.c: Update include.
	* remote.c: Update include.
	* remote-notif.c: Update include.
	* remote-fileio.c: Update include.
	* record-full.c: Update include.
	* record-btrace.c: Update include.
	* python/python.c: Update include.
	* posix-hdep.c: Update include.
	* mingw-hdep.c: Update include.
	* mi/mi-main.c: Update include.
	* mi/mi-interp.c: Update include.
	* main.c: Update include.
	* linux-nat.c: Update include.
	* interps.c: Update include.
	* infrun.c: Update include.
	* inf-loop.c: Update include.
	* event-top.c: Update include.
	* event-loop.c: Move to ../gdbsupport/.
	* event-loop.h: Move to ../gdbsupport/.
	* async-event.h: Update include.
	* Makefile.in (COMMON_SFILES, HFILES_NO_SRCDIR): Update.

gdbsupport/ChangeLog
2020-04-13  Tom Tromey  <tom@tromey.com>

	* event-loop.h: Move from ../gdb/.
	* event-loop.cc: Move from ../gdb/.
2020-04-13 14:10:04 -06:00