aboutsummaryrefslogtreecommitdiff
path: root/gdb/testsuite/gdb.base/break-interp-lib.c
diff options
context:
space:
mode:
authorJan Kratochvil <jan.kratochvil@redhat.com>2010-01-14 21:12:00 +0000
committerJan Kratochvil <jan.kratochvil@redhat.com>2010-01-14 21:12:00 +0000
commitbbfba9ed150f56ba5b09360314b30381a865ff5c (patch)
treee19bd8850f4c2d90c1a662b736907121b67939b8 /gdb/testsuite/gdb.base/break-interp-lib.c
parent61f0d76280d963a9ecf3a3a525dae7ac21050636 (diff)
downloadgdb-bbfba9ed150f56ba5b09360314b30381a865ff5c.zip
gdb-bbfba9ed150f56ba5b09360314b30381a865ff5c.tar.gz
gdb-bbfba9ed150f56ba5b09360314b30381a865ff5c.tar.bz2
gdb/testsuite/
* 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.
Diffstat (limited to 'gdb/testsuite/gdb.base/break-interp-lib.c')
-rw-r--r--gdb/testsuite/gdb.base/break-interp-lib.c20
1 files changed, 18 insertions, 2 deletions
diff --git a/gdb/testsuite/gdb.base/break-interp-lib.c b/gdb/testsuite/gdb.base/break-interp-lib.c
index c103da3..9ca943e 100644
--- a/gdb/testsuite/gdb.base/break-interp-lib.c
+++ b/gdb/testsuite/gdb.base/break-interp-lib.c
@@ -16,9 +16,25 @@
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 (void)
+libfunc (const char *action)
{
- raise (SIGSEGV);
+ assert (action != NULL);
+
+ if (strcmp (action, "segv") == 0)
+ raise (SIGSEGV);
+
+ if (strcmp (action, "sleep") == 0)
+ {
+ puts ("sleeping");
+ fflush (stdout);
+
+ sleep (60);
+ }
+
+ assert (0);
}