mirror of
https://github.com/bminor/binutils-gdb.git
synced 2025-12-05 15:15:42 +00:00
This adds a couple testcases that exercise interrupting programs that block SIGINT. One tests a program that uses sigprocmask to mask out SIGINT, and the other tests a program that waits for SIGINT with sigwait. On GNU/Linux, it is currently impossible to interrupt such a program with Ctrl-C, and you can't interrupt it with the "interrupt" command in all-stop mode either. These currently fail, and are suitably kfailed. The rest of the series will fix the fails. Tested on GNU/Linux native, gdbserver, and gdbserver + "maint set target-non-stop on". gdb/testsuite/ChangeLog: yyyy-mm-dd Pedro Alves <pedro@palves.net> PR gdb/9425 PR gdb/14559 * gdb.base/sigint-masked-out.c: New file. * gdb.base/sigint-masked-out.exp: New file. * gdb.base/sigint-sigwait.c: New file. * gdb.base/sigint-sigwait.exp: New file. Change-Id: Iddb70c0a2c92550027fccb6f51ecba1292d233c8
44 lines
1012 B
C
44 lines
1012 B
C
/* This testcase is part of GDB, the GNU debugger.
|
|
|
|
Copyright 2021 Free Software Foundation, Inc.
|
|
|
|
This program is free software; you can redistribute it and/or modify
|
|
it under the terms of the GNU General Public License as published by
|
|
the Free Software Foundation; either version 3 of the License, or
|
|
(at your option) any later version.
|
|
|
|
This program is distributed in the hope that it will be useful,
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
GNU General Public License for more details.
|
|
|
|
You should have received a copy of the GNU General Public License
|
|
along with this program. If not, see <http://www.gnu.org/licenses/>. */
|
|
|
|
#include <unistd.h>
|
|
#include <signal.h>
|
|
|
|
static void
|
|
done ()
|
|
{
|
|
}
|
|
|
|
int
|
|
main (int argc, char *argv[])
|
|
{
|
|
int i;
|
|
sigset_t sigs;
|
|
|
|
alarm (30);
|
|
|
|
sigfillset (&sigs);
|
|
sigprocmask (SIG_SETMASK, &sigs, NULL);
|
|
|
|
done ();
|
|
|
|
while (1)
|
|
sleep (1);
|
|
|
|
return 0;
|
|
}
|