[gdb/breakpoints] Fix segfault for catch syscall -1
Using a hello world a.out, I run into a segfault:
...
$ gcc hello.c
$ gdb -batch a.out -ex "catch syscall -1" -ex r
Catchpoint 1 (syscall -1)
Aborted (core dumped)
...
Fix this by erroring out if a negative syscall number is used in the
catch syscall command.
Tested on x86_64-linux.
gdb/ChangeLog:
2021-02-05 Tom de Vries <tdevries@suse.de>
PR breakpoints/27313
* break-catch-syscall.c (catch_syscall_split_args): Reject negative
syscall numbers.
gdb/testsuite/ChangeLog:
2021-02-05 Tom de Vries <tdevries@suse.de>
PR breakpoints/27313
* gdb.base/catch-syscall.exp: Check that "catch syscall -1" is
rejected.