]> git.ipfire.org Git - thirdparty/binutils-gdb.git/blame - gdb/testsuite/gdb.arch/i386-unwind.c
gas: ginsn: remove unnecessary buffer allocation and free
[thirdparty/binutils-gdb.git] / gdb / testsuite / gdb.arch / i386-unwind.c
CommitLineData
67455b2a
MK
1/* Unwinder test program.
2
1d506c26 3 Copyright 2003-2024 Free Software Foundation, Inc.
67455b2a
MK
4
5 This file is part of GDB.
6
7 This program is free software; you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by
a9762ec7 9 the Free Software Foundation; either version 3 of the License, or
67455b2a 10 (at your option) any later version.
a9762ec7 11
67455b2a
MK
12 This program is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details.
a9762ec7 16
67455b2a 17 You should have received a copy of the GNU General Public License
a9762ec7 18 along with this program. If not, see <http://www.gnu.org/licenses/>. */
67455b2a 19
daab1251
CV
20#ifdef SYMBOL_PREFIX
21#define SYMBOL(str) SYMBOL_PREFIX #str
22#else
23#define SYMBOL(str) #str
24#endif
25
67455b2a
MK
26void
27trap (void)
28{
29 asm ("int $0x03");
30}
31
32/* Make sure that main directly follows a function without an
33 epilogue. */
34
35asm(".text\n"
36 " .align 8\n"
37 " .globl gdb1435\n"
38 "gdb1435:\n"
39 " pushl %ebp\n"
40 " mov %esp, %ebp\n"
daab1251
CV
41 " call " SYMBOL (trap) "\n"
42 " .globl " SYMBOL (main) "\n"
43 SYMBOL (main) ":\n"
67455b2a
MK
44 " pushl %ebp\n"
45 " mov %esp, %ebp\n"
46 " call gdb1435\n");