summaryrefslogtreecommitdiff
path: root/bfd/version.h
diff options
context:
space:
mode:
authorSimon Marchi <simon.marchi@efficios.com>2023-03-03 11:37:44 -0500
committerSimon Marchi <simon.marchi@efficios.com>2023-03-03 14:13:00 -0500
commit803392dc5bb4cf293a621c4edf2842b647267d3d (patch)
tree1ebf6e7634ebd0c59a9a559ca1e6778632573ed7 /bfd/version.h
parent9c2c346137eeca000840023b6d9340274da7a905 (diff)
downloadbinutils-gdb-803392dc5bb4cf293a621c4edf2842b647267d3d.tar.gz
gdb/testsuite: use `kill -FOO` instead of `kill -SIGFOO`
When running gdb.base/bg-exec-sigint-bp-cond.exp when SHELL is dash, rather than bash, I get: c&^M Continuing.^M (gdb) sh: 1: kill: Illegal option -S^M ^M Breakpoint 2, foo () at /home/jenkins/smarchi/binutils-gdb/build/gdb/testsuite/../../../gdb/testsuite/gdb.base/bg-exec-sigint-bp-cond.c:23^M 23 return 0;^M FAIL: gdb.base/bg-exec-sigint-bp-cond.exp: no force memory write: SIGINT does not interrupt background execution (timeout) This is because it uses the kill command built-in the dash shell, and using the SIG prefix with kill does not work with dash's kill. The difference is listed in the documentation for bash's POSIX-correct mode [1]: The kill builtin does not accept signal names with a ‘SIG’ prefix. Replace SIGINT with INT in that test. By grepping, I found two other instances (gdb.base/sigwinch-notty.exp and gdb.threads/detach-step-over.exp). Those were not problematic on my system though. Since they are done through remote_exec, they don't go through the shell and therefore invoke /bin/kill. On my Arch Linux, it's: $ /bin/kill --version kill from util-linux 2.38.1 (with: sigqueue, pidfd) and on my Ubuntu: $ /bin/kill --version kill from procps-ng 3.3.17 These two implementations accept "-SIGINT". But according to the POSIX spec [2], the kill utility should recognize the signal name without the SIG prefix (if it recognizes them with the SIG prefix, it's an extension): -s signal_name Specify the signal to send, using one of the symbolic names defined in the <signal.h> header. Values of signal_name shall be recognized in a case-independent fashion, without the SIG prefix. In addition, the symbolic name 0 shall be recognized, representing the signal value zero. The corresponding signal shall be sent instead of SIGTERM. -signal_name [XSI] [Option Start] Equivalent to -s signal_name. [Option End] So, just in case some /bin/kill implementation happens to not recognize the SIG prefixes, change these two other calls to remove the SIG prefix. [1] https://www.gnu.org/software/bash/manual/html_node/Bash-POSIX-Mode.html [2] https://pubs.opengroup.org/onlinepubs/9699919799/utilities/kill.html Change-Id: I81ccedd6c9428ab63b9261813f1905a18941f8da Reviewed-By: Tom Tromey <tom@tromey.com>
Diffstat (limited to 'bfd/version.h')
0 files changed, 0 insertions, 0 deletions