Work around an incorrect string dump syntax produced by some gdb versions.
[kdbg.git] / kdbg / testprogs / repeats.cpp
bloba0b024d75f3895597909925c0f9b67f2fc69c00c
1 // test <repeats 30 times> in arrays
3 #include <iostream>
4 #include <qstring.h>
6 struct Big {
7 struct bog {
8 short b[40];
9 } a[40];
10 short c[40][40];
13 static void f(int)
18 static void IncompleteCharTest()
20 // this string triggers a bug in gdb's string dumping routine
21 char s1[] = "abbbbbbbbbbbbbbbbbbbb\240ccc";
22 char s2[] = "abbbbbbbbbbbbbbbbbbbb\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240ccc";
23 // this variable should be visible in the Local Variables window
24 int n = 2;
25 std::cout << s1 << s2 << n << std::endl;
28 int main()
30 struct Big big = {{{ 2,}}};
31 big.a[0].b[39]=7;
32 big.a[38].b[39]=6;
34 // array of pointer to function
35 void (*apf[30])(int);
37 for (int i = 1; i < 29; i++)
38 apf[i] = f;
40 QString s[300];
42 for (int i = 0; i < 300; i++)
43 s[i].sprintf("String %d", i);
45 s[21] = s[48];
47 int many[300];
48 for (int i = 0; i < 300; i++)
49 many[i] = i;
51 IncompleteCharTest();
52 return 0;