bbfba9ed15
* gdb.base/break-interp-lib.c: Include unistd.h, assert.h and stdio.h. (libfunc): New parameter action. Implement also selectable "sleep". * gdb.base/break-interp-main.c: Include assert.h. (libfunc): New parameter action. (main): New parameters argc and argv. Assert argc. Pass argv. * gdb.base/break-interp.exp (test_core): Pass the "segv" argument. (test_attach): New proc. (test_ld): Pass new "segv" exec parameter. Call also test_attach. * lib/gdb.exp (core_find): New parameter arg. Pass it to $binfile.
40 lines
1.1 KiB
C
40 lines
1.1 KiB
C
/* This testcase is part of GDB, the GNU debugger.
|
|
|
|
Copyright 2009 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 <signal.h>
|
|
#include <unistd.h>
|
|
#include <assert.h>
|
|
#include <stdio.h>
|
|
|
|
void
|
|
libfunc (const char *action)
|
|
{
|
|
assert (action != NULL);
|
|
|
|
if (strcmp (action, "segv") == 0)
|
|
raise (SIGSEGV);
|
|
|
|
if (strcmp (action, "sleep") == 0)
|
|
{
|
|
puts ("sleeping");
|
|
fflush (stdout);
|
|
|
|
sleep (60);
|
|
}
|
|
|
|
assert (0);
|
|
}
|