linux-nat: Eliminate custom target_terminal_{inferior,ours}, stop using set_sigint_trap
This patch gets rid of linux-nat.c's custom
target_terminal_inferior/target_terminal_ours implementations.
The only remaining reason those overrides exist is to install
clear_sigint_trap in order to pass Ctrl-C/SIGINT to the inferior
process in case the inferior is not sharing GDB's terminal (and
target_wait was called without TARGET_WNOHANG).
However, I think that's better handled by QUIT / target_pass_ctrlc
nowadays. Going that route avoids the issue with set_sigint_trap only
looking at the current inferior to know whether to override SIGINT or
not, which doesn't really work correctly with multi-inferior in the
picture. Also centralizing on a single SIGINT handler as much as
possible seems better considering a future multi-target world.
Tested on x86-64 GNU/Linux.
gdb/ChangeLog:
2018-01-30 Pedro Alves <palves@redhat.com>
* linux-nat.c (wait_for_signal): New function.
(wait_lwp, linux_nat_wait_1): Use it instead of calling sigsuspend
directly.
(async_terminal_is_ours)
(linux_nat_terminal_inferior, linux_nat_terminal_ours): Delete.
(linux_nat_add_target): Don't override
to_terminal_inferior/to_terminal_ours.