aboutsummaryrefslogtreecommitdiff
path: root/gdb/testsuite/gdb.multi/bkpt-multi-exec.c
blob: eb002fb2545b5a8c02ebcf4644e39cff3c03521f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <string.h>
#include <limits.h>

int main (int argc, char ** argv)
{
  char prog[PATH_MAX];
  int len;

  strcpy (prog, argv[0]);
  len = strlen (prog);
  /* Replace "bkpt-multi-exec" with "crashme".  */
  memcpy (prog + len - 15, "crashme", 7);
  prog[len - 8] = 0;

  printf ("foll-exec is about to execl(crashme)...\n");

  execl (prog,
         prog,
         (char *)0);
}