aboutsummaryrefslogtreecommitdiff
path: root/gdb/testsuite/gdb.base/foll-exec.c
diff options
context:
space:
mode:
authorJason Molenda <jmolenda@apple.com>1999-06-28 23:04:32 +0000
committerJason Molenda <jmolenda@apple.com>1999-06-28 23:04:32 +0000
commit74cf13956febb1f6c8e0f5d5f48814953d41dd28 (patch)
treef06240a34afca06791450a91c8aac297abda27df /gdb/testsuite/gdb.base/foll-exec.c
parent9cd2c67bacb9aaa7e82457e68e1a6087c8bde928 (diff)
downloadgdb-74cf13956febb1f6c8e0f5d5f48814953d41dd28.zip
gdb-74cf13956febb1f6c8e0f5d5f48814953d41dd28.tar.gz
gdb-74cf13956febb1f6c8e0f5d5f48814953d41dd28.tar.bz2
import gdb-1999-06-28 snapshot
Diffstat (limited to 'gdb/testsuite/gdb.base/foll-exec.c')
-rw-r--r--gdb/testsuite/gdb.base/foll-exec.c43
1 files changed, 43 insertions, 0 deletions
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 <stdio.h>
+#include <stdlib.h>
+#include <unistd.h>
+#include <string.h>
+
+
+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);
+ }
+}