Home | History | Annotate | Line # | Download | only in gdb.multi
      1 #include <stdio.h>
      2 #include <stdlib.h>
      3 #include <unistd.h>
      4 #include <string.h>
      5 #include <limits.h>
      6 
      7 int main (int argc, char ** argv)
      8 {
      9   char prog[PATH_MAX];
     10   int len;
     11 
     12   strcpy (prog, argv[0]);
     13   len = strlen (prog);
     14   /* Replace "bkpt-multi-exec" with "crashme".  */
     15   memcpy (prog + len - 15, "crashme", 7);
     16   prog[len - 8] = 0;
     17 
     18   printf ("foll-exec is about to execl(crashme)...\n");
     19 
     20   execl (prog,
     21          prog,
     22          (char *)0);
     23 }
     24