OSDN Git Service

Update/correct copyright notices.
[pf3gnuchains/pf3gnuchains3x.git] / gdb / config / i386 / nm-linux.h
1 /* Native support for Linux/x86.
2    Copyright 1986, 1987, 1989, 1992, 1993, 1994, 1995, 1996, 1997, 1998,
3    1999, 2000
4    Free 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 NM_LINUX_H
24 #define NM_LINUX_H
25
26 #include "i386/nm-i386v.h"
27 #include "nm-linux.h"
28
29 /* Return sizeof user struct to callers in less machine dependent routines */
30
31 #define KERNEL_U_SIZE kernel_u_size()
32 extern int kernel_u_size (void);
33
34 #define U_REGS_OFFSET 0
35
36 /* GNU/Linux supports the 386 hardware debugging registers.  */
37
38 #define TARGET_HAS_HARDWARE_WATCHPOINTS
39
40 #define TARGET_CAN_USE_HARDWARE_WATCHPOINT(type, cnt, ot) 1
41
42 /* After a watchpoint trap, the PC points to the instruction after
43    the one that caused the trap.  Therefore we don't need to step over it.
44    But we do need to reset the status register to avoid another trap.  */
45 #define HAVE_CONTINUABLE_WATCHPOINT
46
47 #define STOPPED_BY_WATCHPOINT(W)  \
48   i386_stopped_by_watchpoint (inferior_pid)
49
50 /* Use these macros for watchpoint insertion/removal.  */
51
52 #define target_insert_watchpoint(addr, len, type)  \
53   i386_insert_watchpoint (inferior_pid, addr, len, type)
54
55 #define target_remove_watchpoint(addr, len, type)  \
56   i386_remove_watchpoint (inferior_pid, addr, len)
57
58 /* We define this if link.h is available, because with ELF we use SVR4 style
59    shared libraries. */
60
61 #ifdef HAVE_LINK_H
62 #define SVR4_SHARED_LIBS
63 #include "solib.h"              /* Support for shared libraries. */
64 #endif
65
66 /* Override copies of {fetch,store}_inferior_registers in `infptrace.c'.  */
67 #define FETCH_INFERIOR_REGISTERS
68
69 /* Nevertheless, define CANNOT_{FETCH,STORE}_REGISTER, because we might fall
70    back on the code `infptrace.c' (well a copy of that code in
71    `i386-linux-nat.c' for now) and we can access only the
72    general-purpose registers in that way.  */
73 extern int cannot_fetch_register (int regno);
74 extern int cannot_store_register (int regno);
75 #define CANNOT_FETCH_REGISTER(regno) cannot_store_register (regno)
76 #define CANNOT_STORE_REGISTER(regno) cannot_fetch_register (regno)
77
78 /* Override child_resume in `infptrace.c'.  */
79 #define CHILD_RESUME
80
81 extern CORE_ADDR i386_stopped_by_watchpoint (int);
82 extern int i386_insert_watchpoint (int pid, CORE_ADDR addr, int len, int rw);
83 extern int i386_remove_watchpoint (int pid, CORE_ADDR addr, int len);
84
85 /* FIXME: kettenis/2000-09-03: This should be moved to ../nm-linux.h
86    once we have converted all Linux targets to use the new threads
87    stuff (without the #undef of course).  */
88
89 extern int lin_lwp_prepare_to_proceed (void);
90 #undef PREPARE_TO_PROCEED
91 #define PREPARE_TO_PROCEED(select_it) lin_lwp_prepare_to_proceed ()
92
93 extern void lin_lwp_attach_lwp (int pid, int verbose);
94 #define ATTACH_LWP(pid, verbose) lin_lwp_attach_lwp ((pid), (verbose))
95
96 #include <signal.h>
97
98 extern void lin_thread_get_thread_signals (sigset_t *mask);
99 #define GET_THREAD_SIGNALS(mask) lin_thread_get_thread_signals (mask)
100
101 #endif /* nm_linux.h */