xref: /netbsd-src/external/gpl3/gdb.old/dist/gdb/testsuite/gdb.base/huge.c (revision a5a4af3bd380a7b58b758d9b311cef9f7c34aeb4)
1*a5a4af3bSchristos /*
2*a5a4af3bSchristos  * Test GDB's ability to read a very large data object from target memory.
3*a5a4af3bSchristos  */
4*a5a4af3bSchristos 
5*a5a4af3bSchristos #include <string.h>
6*a5a4af3bSchristos 
7*a5a4af3bSchristos /* A value that will produce a target data object large enough to
8*a5a4af3bSchristos    crash GDB.  0x200000 is big enough on GNU/Linux, other systems may
9*a5a4af3bSchristos    need a larger number.  */
10*a5a4af3bSchristos #ifndef CRASH_GDB
11*a5a4af3bSchristos #define CRASH_GDB 0x200000
12*a5a4af3bSchristos #endif
13*a5a4af3bSchristos static int a[CRASH_GDB], b[CRASH_GDB];
14*a5a4af3bSchristos 
15*a5a4af3bSchristos int
main()16*a5a4af3bSchristos main()
17*a5a4af3bSchristos {
18*a5a4af3bSchristos   memcpy (a, b, sizeof (a));
19*a5a4af3bSchristos   return 0;
20*a5a4af3bSchristos }
21