[testsuite] Remove BASEDIR
[deliverable/binutils-gdb.git] / gdb / testsuite / gdb.base / foll-exec-mode.c
index 1a482a5fc1b49b0e9e2e47c0ace85f4e9bed33d4..67686d722f690c95d5717b226150e7263b12261e 100644 (file)
 #include <stdlib.h>
 #include <unistd.h>
 #include <string.h>
+#include <limits.h>
 
 int global_i = 100;
 
-int main (void)
+int main (int argc, char ** argv)
 {
   int local_j = global_i + 1;
   int local_k = local_j + 1;
+  char prog[PATH_MAX];
+  int len;
+
+  strcpy (prog, argv[0]);
+  len = strlen (prog);
+  /* Replace "foll-exec-mode" with "execd-prog".  */
+  memcpy (prog + len - 14, "execd-prog", 10);
+  prog[len - 4] = 0;
 
   printf ("foll-exec is about to execlp(execd-prog)...\n");
 
-  execlp (BASEDIR "/execd-prog",     /* Set breakpoint here.  */
+  execlp (prog,     /* Set breakpoint here.  */
          "/execd-prog",
          "execlp arg1 from foll-exec",
          (char *) 0);
This page took 0.024889 seconds and 4 git commands to generate.