* gdb.stabs/gdb11479.c (hack): New function.
[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 int8_t int8_search_buf[100];
10 int16_t int16_search_buf[100];
11 int32_t int32_search_buf[100];
12 int64_t int64_search_buf[100];
13
14 static char *search_buf;
15 static int search_buf_size;
16
17
18 int f2 (int a)
19 {
20   char *str = "hello, testsuite";
21
22   puts (str);   /* Break here.  */
23
24   return ++a;
25 }
26
27 int f1 (int a, int b)
28 {
29   return f2(a) + b;
30 }
31
32 static void
33 init_bufs ()
34 {
35   search_buf_size = BUF_SIZE;
36   search_buf = malloc (search_buf_size);
37   if (search_buf == NULL)
38     exit (1);
39   memset (search_buf, 'x', search_buf_size);
40 }
41
42 int main (int argc, char *argv[])
43 {
44   init_bufs ();
45
46   return f1 (1, 2);
47 }