2010-06-28 Phil Muldoon <pmuldoon@redhat.com>
[external/binutils.git] / gdb / testsuite / gdb.python / py-inferior.c
1 #include <stdio.h>
2 #include <stdlib.h>
3 #include <stdint.h>
4 #include <string.h>
5
6 #define CHUNK_SIZE 16000 /* same as findcmd.c's */
7 #define BUF_SIZE (2 * CHUNK_SIZE) /* at least two chunks */
8
9 static int8_t int8_search_buf[100];
10 static int16_t int16_search_buf[100];
11 static int32_t int32_search_buf[100];
12 static int64_t int64_search_buf[100];
13
14 static char *search_buf;
15 static int search_buf_size;
16
17 static int x;
18
19
20 int f2 (int a)
21 {
22   char *str = "hello, testsuite";
23
24   puts (str);   /* Break here.  */
25
26   return ++a;
27 }
28
29 int f1 (int a, int b)
30 {
31   return f2(a) + b;
32 }
33
34 static void
35 init_bufs ()
36 {
37   search_buf_size = BUF_SIZE;
38   search_buf = malloc (search_buf_size);
39   if (search_buf == NULL)
40     exit (1);
41   memset (search_buf, 'x', search_buf_size);
42 }
43
44 int main (int argc, char *argv[])
45 {
46   init_bufs ();
47
48   return f1 (1, 2);
49 }