From 74cf13956febb1f6c8e0f5d5f48814953d41dd28 Mon Sep 17 00:00:00 2001 From: Jason Molenda Date: Mon, 28 Jun 1999 23:04:32 +0000 Subject: import gdb-1999-06-28 snapshot --- gdb/testsuite/gdb.base/foll-exec.c | 43 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 gdb/testsuite/gdb.base/foll-exec.c (limited to 'gdb/testsuite/gdb.base/foll-exec.c') diff --git a/gdb/testsuite/gdb.base/foll-exec.c b/gdb/testsuite/gdb.base/foll-exec.c new file mode 100644 index 0000000..1b76090 --- /dev/null +++ b/gdb/testsuite/gdb.base/foll-exec.c @@ -0,0 +1,43 @@ +#include +#include +#include +#include + + +int global_i = 100; + +#ifdef PROTOTYPES +int main (void) +#else +main () +#endif +{ + int local_j = global_i+1; + int local_k = local_j+1; + + printf ("foll-exec is about to execlp(execd-prog)...\n"); + + execlp ("gdb.base/execd-prog", + "gdb.base/execd-prog", + "execlp arg1 from foll-exec", + (char *)0); + + printf ("foll-exec is about to execl(execd-prog)...\n"); + + execl ("gdb.base/execd-prog", + "gdb.base/execd-prog", + "execl arg1 from foll-exec", + "execl arg2 from foll-exec", + (char *)0); + + { + static char * argv[] = { + (char *)"gdb.base/execd-prog", + (char *)"execv arg1 from foll-exec", + (char *)0}; + + printf ("foll-exec is about to execv(execd-prog)...\n"); + + execv ("gdb.base/execd-prog", argv); + } +} -- cgit v1.1