77eb0c681ccc6e85b53dfdfda7d7d2f862d803c6
[deliverable/binutils-gdb.git] / gdb / config / i386 / tm-linux.h
1 /* Definitions to target GDB to GNU/Linux on 386.
2 Copyright 1992, 1993, 1995, 1996, 1998, 1999, 2000, 2001
3 Free Software Foundation, Inc.
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
9 the Free Software Foundation; either version 2 of the License, or
10 (at your option) any later version.
11
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.
16
17 You should have received a copy of the GNU General Public License
18 along with this program; if not, write to the Free Software
19 Foundation, Inc., 59 Temple Place - Suite 330,
20 Boston, MA 02111-1307, USA. */
21
22 #ifndef TM_LINUX_H
23 #define TM_LINUX_H
24
25 #define I386_GNULINUX_TARGET
26 #define HAVE_I387_REGS
27 #ifdef HAVE_PTRACE_GETFPXREGS
28 #define HAVE_SSE_REGS
29 #endif
30
31 #include "i386/tm-i386.h"
32 #include "tm-linux.h"
33
34 /* Linux/ELF uses stabs-in-ELF with the DWARF register numbering
35 scheme by default, so we must redefine STAB_REG_TO_REGNUM. This
36 messes up the floating-point registers for a.out, but there is not
37 much we can do about that. */
38 #undef STAB_REG_TO_REGNUM
39 #define STAB_REG_TO_REGNUM(reg) i386_dwarf_reg_to_regnum ((reg))
40
41 /* Use target_specific function to define link map offsets. */
42 extern struct link_map_offsets *i386_linux_svr4_fetch_link_map_offsets (void);
43 #define SVR4_FETCH_LINK_MAP_OFFSETS() i386_linux_svr4_fetch_link_map_offsets ()
44
45 /* The following works around a problem with /usr/include/sys/procfs.h */
46 #define sys_quotactl 1
47
48 /* When the i386 Linux kernel calls a signal handler, the return
49 address points to a bit of code on the stack. These definitions
50 are used to identify this bit of code as a signal trampoline in
51 order to support backtracing through calls to signal handlers. */
52
53 #define IN_SIGTRAMP(pc, name) i386_linux_in_sigtramp (pc, name)
54 extern int i386_linux_in_sigtramp (CORE_ADDR, char *);
55
56 #undef FRAME_CHAIN
57 #define FRAME_CHAIN(frame) i386_linux_frame_chain (frame)
58 extern CORE_ADDR i386_linux_frame_chain (struct frame_info *frame);
59
60 #undef FRAME_SAVED_PC
61 #define FRAME_SAVED_PC(frame) i386_linux_frame_saved_pc (frame)
62 extern CORE_ADDR i386_linux_frame_saved_pc (struct frame_info *frame);
63
64 #undef SAVED_PC_AFTER_CALL
65 #define SAVED_PC_AFTER_CALL(frame) i386_linux_saved_pc_after_call (frame)
66 extern CORE_ADDR i386_linux_saved_pc_after_call (struct frame_info *);
67
68 /* When we call a function in a shared library, and the PLT sends us
69 into the dynamic linker to find the function's real address, we
70 need to skip over the dynamic linker call. This function decides
71 when to skip, and where to skip to. See the comments for
72 SKIP_SOLIB_RESOLVER at the top of infrun.c. */
73 #define SKIP_SOLIB_RESOLVER i386_linux_skip_solib_resolver
74 extern CORE_ADDR i386_linux_skip_solib_resolver (CORE_ADDR pc);
75
76 /* N_FUN symbols in shared libaries have 0 for their values and need
77 to be relocated. */
78 #define SOFUN_ADDRESS_MAYBE_MISSING
79 \f
80
81 /* Support for longjmp. */
82
83 /* Details about jmp_buf. It's supposed to be an array of integers. */
84
85 #define JB_ELEMENT_SIZE 4 /* Size of elements in jmp_buf. */
86 #define JB_PC 5 /* Array index of saved PC. */
87
88 /* Figure out where the longjmp will land. Slurp the args out of the
89 stack. We expect the first arg to be a pointer to the jmp_buf
90 structure from which we extract the pc (JB_PC) that we will land
91 at. The pc is copied into ADDR. This routine returns true on
92 success. */
93
94 #define GET_LONGJMP_TARGET(addr) get_longjmp_target (addr)
95 extern int get_longjmp_target (CORE_ADDR *addr);
96
97 #endif /* #ifndef TM_LINUX_H */
This page took 0.030675 seconds and 4 git commands to generate.