f3b111adcaadbc0a98848dd8ae569c20a6dce394
[binutils-gdb.git] / gdb / config / i386 / tm-obsd.h
1 /* Target-dependent definitions for OpenBSD/i386.
2 Copyright 2001 Free Software Foundation, Inc.
3
4 This file is part of GDB.
5
6 This program is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 2 of the License, or
9 (at your option) any later version.
10
11 This program is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
15
16 You should have received a copy of the GNU General Public License
17 along with this program; if not, write to the Free Software
18 Foundation, Inc., 59 Temple Place - Suite 330,
19 Boston, MA 02111-1307, USA. */
20
21 #ifndef TM_OBSD_H
22 #define TM_OBSD_H
23
24 #include "i386/tm-i386.h"
25
26 /* OpenBSD uses the old gcc convention for struct returns. */
27
28 #define USE_STRUCT_CONVENTION(gcc_p, type) \
29 generic_use_struct_convention (1, type)
30 \f
31
32 /* Support for longjmp. */
33
34 /* Details about jmp_buf. It's supposed to be an array of integers. */
35
36 #define JB_ELEMENT_SIZE 4 /* Size of elements in jmp_buf. */
37 #define JB_PC 0 /* Array index of saved PC. */
38
39 /* Figure out where the longjmp will land. Store the address that
40 longjmp will jump to in *ADDR, and return non-zero if successful. */
41
42 #define GET_LONGJMP_TARGET(addr) get_longjmp_target (addr)
43 extern int get_longjmp_target (CORE_ADDR *addr);
44 \f
45
46 /* Support for signal handlers. */
47
48 #define IN_SIGTRAMP(pc, name) i386bsd_in_sigtramp (pc, name)
49 extern int i386bsd_in_sigtramp (CORE_ADDR pc, char *name);
50
51 /* These defines allow the recognition of sigtramps as a function name
52 <sigtramp>.
53
54 FIXME: kettenis/2001-07-13: These should be added to the target
55 vector and turned into functions when we go "multi-arch". */
56
57 #define SIGTRAMP_START(pc) i386bsd_sigtramp_start
58 #define SIGTRAMP_END(pc) i386bsd_sigtramp_end
59 extern CORE_ADDR i386bsd_sigtramp_start;
60 extern CORE_ADDR i386bsd_sigtramp_end;
61
62 /* Override FRAME_SAVED_PC to enable the recognition of signal handlers. */
63
64 #undef FRAME_SAVED_PC
65 #define FRAME_SAVED_PC(frame) i386bsd_frame_saved_pc (frame)
66 extern CORE_ADDR i386bsd_frame_saved_pc (struct frame_info *frame);
67 \f
68
69 /* Shared library support. */
70
71 /* Return non-zero if we are in a shared library trampoline code stub. */
72
73 #define IN_SOLIB_CALL_TRAMPOLINE(pc, name) \
74 (name && !strcmp(name, "_DYNAMIC"))
75
76 #endif /* tm-obsd.h */