gdb/python: don't allow the user to delete window title attributes
[deliverable/binutils-gdb.git] / gdb / testsuite / gdb.base / foll-exec-mode.c
index 1a482a5fc1b49b0e9e2e47c0ace85f4e9bed33d4..699e717dc2cfc1d2f70c4836f952183aeb8563f2 100644 (file)
@@ -1,6 +1,6 @@
 /* This test program is part of GDB, the GNU debugger.
 
-   Copyright 2015-2016 Free Software Foundation, Inc.
+   Copyright 2015-2021 Free Software Foundation, Inc.
 
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
 #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.026198 seconds and 4 git commands to generate.