openocd/src
Brent Roman c584686fd1 server: Improve signal handling under Linux
Commit 5087a955 added custom signal handlers for the openocd
server process.

Before this commit, when openocd is run as a background process
having the same controlling terminal as gdb, Control-C would be
handled by gdb to stop target execution and return to the gdb prompt.

However, after commit 5087a955, the SIGINT caused by pressing
Control-C also terminates openocd, effectively crashing the
debugging session.  The only way to avoid this is run openocd in
a different controling terminal or to detach openocd from its
controlling terminal,
thus losing all job control for the openocd process.

This patch improves the server's handling of POSIX signals:
1) Keyboard generated signals (INT and QUIT) are ignored
   when server process has is no controlling terminal.
2) SIGHUP and SIGPIPE are handled to ensure that .quit functions
   for each interface are called if user's logs out of X
   session or there is a network failure.

SIG_INT & SIG_QUIT still stop openocd
when it is running in the foreground.

Change-Id: I03ad645e62408fdaf4edc49a3550b89b287eda10
Signed-off-by: Brent Roman <genosensor@gmail.com>
Signed-off-by: Tomas Vanek <vanekt@fbl.cz>
Reviewed-on: http://openocd.zylin.com/3963
Tested-by: jenkins
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
2018-07-21 07:43:23 +01:00
..
flash nrf5: Add HWID 0x139 (52832 rev E0) 2018-07-18 21:11:12 +01:00
helper helper/types: cast to uint32_t,uint16_t to avoid UB by shifting int too far 2018-03-12 14:12:07 +00:00
jtag target/armv7m_trace: Use prefix for enums 2018-07-19 10:49:24 +01:00
pld
rtos ChibiOS thread states: Update thread state to label mapping 2018-04-23 20:46:52 +01:00
server server: Improve signal handling under Linux 2018-07-21 07:43:23 +01:00
svf svf: improve robustness when processing invalid SVF files 2018-03-13 08:41:21 +00:00
target target/aarch64: Call aarch64_init_debug_access() earlier in aarch64_deassert_reset() 2018-07-20 15:14:46 +01:00
transport configure: disable all drivers when zy1000 is enabled 2018-04-09 09:04:46 +01:00
xsvf
hello.c
hello.h
main.c
Makefile.am
openocd.c armv8: valgrind memleak fixes 2018-04-10 09:13:02 +01:00
openocd.h