1 /* Copyright 1992-1996, 1999, 2007-2012 Free Software Foundation, Inc.
3 This file is part of GDB.
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
7 the Free Software Foundation; either version 3 of the License, or
8 (at your option) any later version.
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details.
15 You should have received a copy of the GNU General Public License
16 along with this program. If not, see <http://www.gnu.org/licenses/>. */
18 /* Simple little program that just generates a core dump from inside some
19 nested function calls. Keep this as self contained as possible, I.E.
20 use no environment resources other than possibly abort(). */
33 #define ABORT {char *invalid = 0; *invalid = 0xFF;}
36 /* Don't make these automatic vars or we will have to walk back up the
37 stack to access them. */
42 int coremaker_data = 1; /* In Data section */
43 int coremaker_bss; /* In BSS section */
45 const int coremaker_ro = 201; /* In Read-Only Data section */
50 int coremaker_local[5];
54 /* Make sure that coremaker_local doesn't get optimized away. */
55 for (i = 0; i < 5; i++)
56 coremaker_local[i] = i;
58 for (i = 0; i < 5; i++)
59 coremaker_bss += coremaker_local[i];
60 coremaker_data = coremaker_ro + 1;