OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [tags/] [gnu-src/] [gdb-7.2/] [gdb-7.2-or32-1.0rc3/] [gdb/] [testsuite/] [gdb.base/] [foll-fork.c] - Blame information for rev 513

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 330 jeremybenn
#include <stdio.h>
2
#include <unistd.h>
3
#include <stdlib.h>
4
 
5
#ifdef PROTOTYPES
6
void callee (int i)
7
#else
8
void callee (i)
9
  int  i;
10
#endif
11
{
12
  /* Any output corrupts GDB CLI expect strings.
13
     printf("callee: %d\n", i);  */
14
}
15
 
16
#ifdef PROTOTYPES
17
int main (void)
18
#else
19
main ()
20
#endif
21
{
22
  int  pid;
23
  int  v = 5;
24
 
25
  pid = fork ();
26
  if (pid == 0) /* set breakpoint here */
27
    {
28
      v++;
29
      /* printf ("I'm the child!\n"); */
30
      callee (getpid ());
31
    }
32
  else
33
    {
34
      v--;
35
      /* printf ("I'm the proud parent of child #%d!\n", pid); */
36
      callee (getpid ());
37
    }
38
 
39
  exit (0); /* at exit */
40
}

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.