mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-08-06 14:49:38 +08:00
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 cbe256847e19 ("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
This commit is contained in:

committed by
Simon Marchi

parent
a7aba2668a
commit
2554f6f564
@ -1,3 +1,10 @@
|
||||
2020-10-02 Simon Marchi <simon.marchi@polymtl.ca>
|
||||
|
||||
* linux-low.cc (linux_process_target::async): Pass name to
|
||||
add_file_handler.
|
||||
* remote-utils.cc (handle_accept_event): Likewise.
|
||||
(remote_open): Likewise.
|
||||
|
||||
2020-10-01 Kamil Rytarowski <n54@gmx.com>
|
||||
|
||||
* netbsd-i386-low.cc: Add.
|
||||
|
@ -6092,7 +6092,8 @@ linux_process_target::async (bool enable)
|
||||
|
||||
/* Register the event loop handler. */
|
||||
add_file_handler (linux_event_pipe[0],
|
||||
handle_target_event, NULL);
|
||||
handle_target_event, NULL,
|
||||
"linux-low");
|
||||
|
||||
/* Always trigger a linux_wait. */
|
||||
async_file_mark ();
|
||||
|
@ -194,7 +194,7 @@ handle_accept_event (int err, gdb_client_data client_data)
|
||||
enable_async_notification (remote_desc);
|
||||
|
||||
/* Register the event loop handler. */
|
||||
add_file_handler (remote_desc, handle_serial_event, NULL);
|
||||
add_file_handler (remote_desc, handle_serial_event, NULL, "remote-net");
|
||||
|
||||
/* We have a new GDB connection now. If we were disconnected
|
||||
tracing, there's a window where the target could report a stop
|
||||
@ -331,7 +331,7 @@ remote_open (const char *name)
|
||||
enable_async_notification (remote_desc);
|
||||
|
||||
/* Register the event loop handler. */
|
||||
add_file_handler (remote_desc, handle_serial_event, NULL);
|
||||
add_file_handler (remote_desc, handle_serial_event, NULL, "remote-stdio");
|
||||
}
|
||||
#ifndef USE_WIN32API
|
||||
else if (port_str == NULL)
|
||||
@ -372,7 +372,8 @@ remote_open (const char *name)
|
||||
enable_async_notification (remote_desc);
|
||||
|
||||
/* Register the event loop handler. */
|
||||
add_file_handler (remote_desc, handle_serial_event, NULL);
|
||||
add_file_handler (remote_desc, handle_serial_event, NULL,
|
||||
"remote-device");
|
||||
}
|
||||
#endif /* USE_WIN32API */
|
||||
else
|
||||
@ -398,7 +399,8 @@ remote_open (const char *name)
|
||||
fflush (stderr);
|
||||
|
||||
/* Register the event loop handler. */
|
||||
add_file_handler (listen_desc, handle_accept_event, NULL);
|
||||
add_file_handler (listen_desc, handle_accept_event, NULL,
|
||||
"remote-listen");
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user