summaryrefslogtreecommitdiff
path: root/gdb/testsuite/gdb.hp/foll-exec.c
diff options
context:
space:
mode:
Diffstat (limited to 'gdb/testsuite/gdb.hp/foll-exec.c')
-rw-r--r--gdb/testsuite/gdb.hp/foll-exec.c35
1 files changed, 35 insertions, 0 deletions
diff --git a/gdb/testsuite/gdb.hp/foll-exec.c b/gdb/testsuite/gdb.hp/foll-exec.c
new file mode 100644
index 00000000000..c51fa52dcfd
--- /dev/null
+++ b/gdb/testsuite/gdb.hp/foll-exec.c
@@ -0,0 +1,35 @@
+#include <stdio.h>
+
+int global_i = 100;
+
+main ()
+{
+ int local_j = global_i+1;
+ int local_k = local_j+1;
+
+ printf ("follow-exec is about to execlp(execd-program)...\n");
+
+ execlp ("gdb.hp/execd-program",
+ "gdb.hp/execd-program",
+ "execlp arg1 from follow-exec",
+ (char *)0);
+
+ printf ("follow-exec is about to execl(execd-program)...\n");
+
+ execl ("gdb.hp/execd-program",
+ "gdb.hp/execd-program",
+ "execl arg1 from follow-exec",
+ "execl arg2 from follow-exec",
+ (char *)0);
+
+ {
+ static char * argv[] = {
+ "gdb.hp/execd-program",
+ "execv arg1 from follow-exec",
+ 0};
+
+ printf ("follow-exec is about to execv(execd-program)...\n");
+
+ execv ("gdb.hp/execd-program", argv);
+ }
+}