summaryrefslogtreecommitdiff
path: root/gdb/testsuite/gdb.python/py-inferior.c
diff options
context:
space:
mode:
Diffstat (limited to 'gdb/testsuite/gdb.python/py-inferior.c')
-rw-r--r--gdb/testsuite/gdb.python/py-inferior.c49
1 files changed, 49 insertions, 0 deletions
diff --git a/gdb/testsuite/gdb.python/py-inferior.c b/gdb/testsuite/gdb.python/py-inferior.c
new file mode 100644
index 00000000000..0b48299a60e
--- /dev/null
+++ b/gdb/testsuite/gdb.python/py-inferior.c
@@ -0,0 +1,49 @@
+#include <stdio.h>
+#include <stdlib.h>
+#include <stdint.h>
+#include <string.h>
+
+#define CHUNK_SIZE 16000 /* same as findcmd.c's */
+#define BUF_SIZE (2 * CHUNK_SIZE) /* at least two chunks */
+
+static int8_t int8_search_buf[100];
+static int16_t int16_search_buf[100];
+static int32_t int32_search_buf[100];
+static int64_t int64_search_buf[100];
+
+static char *search_buf;
+static int search_buf_size;
+
+static int x;
+
+
+int f2 (int a)
+{
+ char *str = "hello, testsuite";
+
+ puts (str); /* Break here. */
+
+ return ++a;
+}
+
+int f1 (int a, int b)
+{
+ return f2(a) + b;
+}
+
+static void
+init_bufs ()
+{
+ search_buf_size = BUF_SIZE;
+ search_buf = malloc (search_buf_size);
+ if (search_buf == NULL)
+ exit (1);
+ memset (search_buf, 'x', search_buf_size);
+}
+
+int main (int argc, char *argv[])
+{
+ init_bufs ();
+
+ return f1 (1, 2);
+}