s/Linux/.../
[deliverable/binutils-gdb.git] / gdb / config / i386 / tm-linux.h
1 /* Definitions to target GDB to GNU/Linux on 386.
2
3 Copyright 1992, 1993, 1995, 1996, 1998, 1999, 2000, 2001, 2002 Free
4 Software Foundation, Inc.
5
6 This file is part of GDB.
7
8 This program is free software; you can redistribute it and/or modify
9 it under the terms of the GNU General Public License as published by
10 the Free Software Foundation; either version 2 of the License, or
11 (at your option) any later version.
12
13 This program is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 GNU General Public License for more details.
17
18 You should have received a copy of the GNU General Public License
19 along with this program; if not, write to the Free Software
20 Foundation, Inc., 59 Temple Place - Suite 330,
21 Boston, MA 02111-1307, USA. */
22
23 #ifndef TM_LINUX_H
24 #define TM_LINUX_H
25
26 #define I386_GNULINUX_TARGET
27 #define HAVE_I387_REGS
28 #ifdef HAVE_PTRACE_GETFPXREGS
29 #define HAVE_SSE_REGS
30 #endif
31
32 #include "i386/tm-i386.h"
33 #include "tm-linux.h"
34
35 /* Register number for the "orig_eax" pseudo-register. If this
36 pseudo-register contains a value >= 0 it is interpreted as the
37 system call number that the kernel is supposed to restart. */
38 #define I386_LINUX_ORIG_EAX_REGNUM (NUM_GREGS + NUM_FREGS + NUM_SSE_REGS)
39
40 /* Adjust a few macros to deal with this extra register. */
41
42 #undef NUM_REGS
43 #define NUM_REGS (NUM_GREGS + NUM_FREGS + NUM_SSE_REGS + 1)
44
45 #undef MAX_NUM_REGS
46 #define MAX_NUM_REGS (16 + 16 + 9 + 1)
47
48 #undef REGISTER_BYTES
49 #define REGISTER_BYTES \
50 (SIZEOF_GREGS + SIZEOF_FPU_REGS + SIZEOF_FPU_CTRL_REGS + SIZEOF_SSE_REGS + 4)
51
52 #undef REGISTER_NAME
53 #define REGISTER_NAME(reg) i386_linux_register_name ((reg))
54 extern char *i386_linux_register_name (int reg);
55
56 #undef REGISTER_BYTE
57 #define REGISTER_BYTE(reg) i386_linux_register_byte ((reg))
58 extern int i386_linux_register_byte (int reg);
59
60 #undef REGISTER_RAW_SIZE
61 #define REGISTER_RAW_SIZE(reg) i386_linux_register_raw_size ((reg))
62 extern int i386_linux_register_raw_size (int reg);
63
64 /* GNU/Linux ELF uses stabs-in-ELF with the DWARF register numbering
65 scheme by default, so we must redefine STAB_REG_TO_REGNUM. This
66 messes up the floating-point registers for a.out, but there is not
67 much we can do about that. */
68 #undef STAB_REG_TO_REGNUM
69 #define STAB_REG_TO_REGNUM(reg) i386_dwarf_reg_to_regnum ((reg))
70
71 /* Use target_specific function to define link map offsets. */
72 extern struct link_map_offsets *i386_linux_svr4_fetch_link_map_offsets (void);
73 #define SVR4_FETCH_LINK_MAP_OFFSETS() i386_linux_svr4_fetch_link_map_offsets ()
74
75 /* The following works around a problem with /usr/include/sys/procfs.h */
76 #define sys_quotactl 1
77
78 /* When the i386 Linux kernel calls a signal handler, the return
79 address points to a bit of code on the stack. These definitions
80 are used to identify this bit of code as a signal trampoline in
81 order to support backtracing through calls to signal handlers. */
82
83 #define IN_SIGTRAMP(pc, name) i386_linux_in_sigtramp (pc, name)
84 extern int i386_linux_in_sigtramp (CORE_ADDR, char *);
85
86 #undef FRAME_CHAIN
87 #define FRAME_CHAIN(frame) i386_linux_frame_chain (frame)
88 extern CORE_ADDR i386_linux_frame_chain (struct frame_info *frame);
89
90 #undef FRAME_SAVED_PC
91 #define FRAME_SAVED_PC(frame) i386_linux_frame_saved_pc (frame)
92 extern CORE_ADDR i386_linux_frame_saved_pc (struct frame_info *frame);
93
94 #undef SAVED_PC_AFTER_CALL
95 #define SAVED_PC_AFTER_CALL(frame) i386_linux_saved_pc_after_call (frame)
96 extern CORE_ADDR i386_linux_saved_pc_after_call (struct frame_info *);
97
98 #define TARGET_WRITE_PC(pc, ptid) i386_linux_write_pc (pc, ptid)
99 extern void i386_linux_write_pc (CORE_ADDR pc, ptid_t ptid);
100
101 /* When we call a function in a shared library, and the PLT sends us
102 into the dynamic linker to find the function's real address, we
103 need to skip over the dynamic linker call. This function decides
104 when to skip, and where to skip to. See the comments for
105 SKIP_SOLIB_RESOLVER at the top of infrun.c. */
106 #define SKIP_SOLIB_RESOLVER i386_linux_skip_solib_resolver
107 extern CORE_ADDR i386_linux_skip_solib_resolver (CORE_ADDR pc);
108
109 /* N_FUN symbols in shared libaries have 0 for their values and need
110 to be relocated. */
111 #define SOFUN_ADDRESS_MAYBE_MISSING
112 \f
113
114 /* Support for longjmp. */
115
116 /* Details about jmp_buf. It's supposed to be an array of integers. */
117
118 #define JB_ELEMENT_SIZE 4 /* Size of elements in jmp_buf. */
119 #define JB_PC 5 /* Array index of saved PC. */
120
121 /* Figure out where the longjmp will land. Slurp the args out of the
122 stack. We expect the first arg to be a pointer to the jmp_buf
123 structure from which we extract the pc (JB_PC) that we will land
124 at. The pc is copied into ADDR. This routine returns true on
125 success. */
126
127 #define GET_LONGJMP_TARGET(addr) get_longjmp_target (addr)
128 extern int get_longjmp_target (CORE_ADDR *addr);
129
130 #endif /* #ifndef TM_LINUX_H */
This page took 0.035305 seconds and 4 git commands to generate.