]> git.ipfire.org Git - thirdparty/binutils-gdb.git/blob - gdb/config/i386/nm-linux.h
import gdb-1999-09-08 snapshot
[thirdparty/binutils-gdb.git] / 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,
20 Boston, MA 02111-1307, USA. */
21
22 #ifndef NM_LINUX_H
23 #define NM_LINUX_H
24
25 #include "i386/nm-i386v.h"
26
27 /* Return sizeof user struct to callers in less machine dependent routines */
28
29 #define KERNEL_U_SIZE kernel_u_size()
30 extern int kernel_u_size PARAMS ((void));
31
32 /* Tell gdb that we can attach and detach other processes */
33 #define ATTACH_DETACH
34
35 #define U_REGS_OFFSET 0
36
37 /* GNU/Linux supports the 386 hardware debugging registers. */
38
39 #define TARGET_HAS_HARDWARE_WATCHPOINTS
40
41 #define TARGET_CAN_USE_HARDWARE_WATCHPOINT(type, cnt, ot) 1
42
43 /* After a watchpoint trap, the PC points to the instruction after
44 the one that caused the trap. Therefore we don't need to step over it.
45 But we do need to reset the status register to avoid another trap. */
46 #define HAVE_CONTINUABLE_WATCHPOINT
47
48 #define STOPPED_BY_WATCHPOINT(W) \
49 i386_stopped_by_watchpoint (inferior_pid)
50
51 /* Use these macros for watchpoint insertion/removal. */
52
53 #define target_insert_watchpoint(addr, len, type) \
54 i386_insert_watchpoint (inferior_pid, addr, len, type)
55
56 #define target_remove_watchpoint(addr, len, type) \
57 i386_remove_watchpoint (inferior_pid, addr, len)
58
59 /* We define this if link.h is available, because with ELF we use SVR4 style
60 shared libraries. */
61
62 #ifdef HAVE_LINK_H
63 #define SVR4_SHARED_LIBS
64 #include "solib.h" /* Support for shared libraries. */
65 #endif
66
67 /* Override copies of {fetch,store}_inferior_registers in infptrace.c. */
68 #define FETCH_INFERIOR_REGISTERS
69
70 extern CORE_ADDR
71 i386_stopped_by_watchpoint PARAMS ((int));
72 extern int
73 i386_insert_watchpoint PARAMS ((int pid, CORE_ADDR addr, int len, int rw));
74 extern int
75 i386_remove_watchpoint PARAMS ((int pid, CORE_ADDR addr, int len));
76
77 /* Support for the glibc linuxthreads package. */
78
79 #ifdef __STDC__
80 struct objfile;
81 #endif
82
83 extern void
84 linuxthreads_new_objfile PARAMS ((struct objfile *objfile));
85 #define target_new_objfile(OBJFILE) linuxthreads_new_objfile (OBJFILE)
86
87 extern char *
88 linuxthreads_pid_to_str PARAMS ((int pid));
89 #define target_pid_to_str(PID) linuxthreads_pid_to_str (PID)
90
91 extern int
92 linuxthreads_prepare_to_proceed PARAMS ((int step));
93 #define PREPARE_TO_PROCEED(select_it) linuxthreads_prepare_to_proceed (1)
94
95 #endif /* #ifndef NM_LINUX_H */