Initial import from FreeBSD RELENG_4:
[dragonfly.git] / contrib / gdb / gdb / config / i386 / nm-linux.h
1 /* Native support for GNU/Linux, for GDB, the GNU debugger.
2    Copyright (C) 1986, 1987, 1989, 1992, 1996, 1998
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, Boston, MA 02111-1307, USA.  */
20
21 #ifndef NM_LINUX_H
22 #define NM_LINUX_H
23
24 #include "i386/nm-i386v.h"
25
26 /* Return sizeof user struct to callers in less machine dependent routines */
27
28 #define KERNEL_U_SIZE kernel_u_size()
29 extern int kernel_u_size PARAMS ((void));
30
31 /* Tell gdb that we can attach and detach other processes */
32 #define ATTACH_DETACH
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 extern CORE_ADDR
67 i386_stopped_by_watchpoint PARAMS ((int));
68 extern int
69 i386_insert_watchpoint PARAMS ((int pid, CORE_ADDR addr, int len, int rw));
70 extern int
71 i386_remove_watchpoint PARAMS ((int pid, CORE_ADDR addr, int len));
72
73 #endif /* #ifndef NM_LINUX_H */