OLD | NEW |
1 /* This testcase is part of GDB, the GNU debugger. | 1 /* This testcase is part of GDB, the GNU debugger. |
2 | 2 |
3 Copyright 2008-2012 Free Software Foundation, Inc. | 3 Copyright 2008-2012 Free Software Foundation, Inc. |
4 | 4 |
5 This program is free software; you can redistribute it and/or modify | 5 This program is free software; you can redistribute it and/or modify |
6 it under the terms of the GNU General Public License as published by | 6 it under the terms of the GNU General Public License as published by |
7 the Free Software Foundation; either version 3 of the License, or | 7 the Free Software Foundation; either version 3 of the License, or |
8 (at your option) any later version. | 8 (at your option) any later version. |
9 | 9 |
10 This program is distributed in the hope that it will be useful, | 10 This program is distributed in the hope that it will be useful, |
(...skipping 30 matching lines...) Expand all Loading... |
41 }; | 41 }; |
42 | 42 |
43 struct lazystring { | 43 struct lazystring { |
44 const char *lazy_str; | 44 const char *lazy_str; |
45 }; | 45 }; |
46 | 46 |
47 struct hint_error { | 47 struct hint_error { |
48 int x; | 48 int x; |
49 }; | 49 }; |
50 | 50 |
| 51 struct children_as_list { |
| 52 int x; |
| 53 }; |
| 54 |
51 #ifdef __cplusplus | 55 #ifdef __cplusplus |
52 struct S : public s { | 56 struct S : public s { |
53 int zs; | 57 int zs; |
54 }; | 58 }; |
55 | 59 |
56 struct SS { | 60 struct SS { |
57 int zss; | 61 int zss; |
58 S s; | 62 S s; |
59 }; | 63 }; |
60 | 64 |
(...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
212 } | 216 } |
213 | 217 |
214 struct nullstr | 218 struct nullstr |
215 { | 219 { |
216 char *s; | 220 char *s; |
217 }; | 221 }; |
218 | 222 |
219 struct string_repr string_1 = { { "one" } }; | 223 struct string_repr string_1 = { { "one" } }; |
220 struct string_repr string_2 = { { "two" } }; | 224 struct string_repr string_2 = { { "two" } }; |
221 | 225 |
| 226 static int |
| 227 eval_func (int p1, int p2, int p3, int p4, int p5, int p6, int p7, int p8) |
| 228 { |
| 229 return p1; |
| 230 } |
| 231 |
| 232 static void |
| 233 eval_sub (void) |
| 234 { |
| 235 struct eval_type_s { int x; } eval1 = { 1 }, eval2 = { 2 }, eval3 = { 3 }, |
| 236 eval4 = { 4 }, eval5 = { 5 }, eval6 = { 6 }, |
| 237 eval7 = { 7 }, eval8 = { 8 }, eval9 = { 9 }; |
| 238 |
| 239 eval1.x++; /* eval-break */ |
| 240 } |
| 241 |
222 int | 242 int |
223 main () | 243 main () |
224 { | 244 { |
225 struct ss ss; | 245 struct ss ss; |
226 struct ss ssa[2]; | 246 struct ss ssa[2]; |
227 struct arraystruct arraystruct; | 247 struct arraystruct arraystruct; |
228 string x = make_string ("this is x"); | 248 string x = make_string ("this is x"); |
229 zzz_type c = make_container ("container"); | 249 zzz_type c = make_container ("container"); |
230 zzz_type c2 = make_container ("container2"); | 250 zzz_type c2 = make_container ("container2"); |
231 const struct string_repr cstring = { { "const string" } }; | 251 const struct string_repr cstring = { { "const string" } }; |
232 /* Clearing by being `static' could invoke an other GDB C++ bug. */ | 252 /* Clearing by being `static' could invoke an other GDB C++ bug. */ |
233 struct nullstr nullstr; | 253 struct nullstr nullstr; |
234 nostring_type nstype, nstype2; | 254 nostring_type nstype, nstype2; |
235 struct memory_error me; | 255 struct memory_error me; |
236 struct ns ns, ns2; | 256 struct ns ns, ns2; |
237 struct lazystring estring, estring2; | 257 struct lazystring estring, estring2; |
238 struct hint_error hint_error; | 258 struct hint_error hint_error; |
| 259 struct children_as_list children_as_list; |
239 | 260 |
240 nstype.elements = narray; | 261 nstype.elements = narray; |
241 nstype.len = 0; | 262 nstype.len = 0; |
242 | 263 |
243 me.s = "blah"; | 264 me.s = "blah"; |
244 | 265 |
245 init_ss(&ss, 1, 2); | 266 init_ss(&ss, 1, 2); |
246 init_ss(ssa+0, 3, 4); | 267 init_ss(ssa+0, 3, 4); |
247 init_ss(ssa+1, 5, 6); | 268 init_ss(ssa+1, 5, 6); |
248 memset (&nullstr, 0, sizeof nullstr); | 269 memset (&nullstr, 0, sizeof nullstr); |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
302 substruct_test (); | 323 substruct_test (); |
303 do_nothing (); | 324 do_nothing (); |
304 #endif | 325 #endif |
305 | 326 |
306 nstype.elements[0] = 7; | 327 nstype.elements[0] = 7; |
307 nstype.elements[1] = 42; | 328 nstype.elements[1] = 42; |
308 nstype.len = 2; | 329 nstype.len = 2; |
309 | 330 |
310 nstype2 = nstype; | 331 nstype2 = nstype; |
311 | 332 |
| 333 eval_sub (); |
| 334 |
312 return 0; /* break to inspect struct and union */ | 335 return 0; /* break to inspect struct and union */ |
313 } | 336 } |
OLD | NEW |