1 /* Native support for GNU/Linux x86.
3 Copyright 1986, 1987, 1989, 1992, 1993, 1994, 1995, 1996, 1997,
4 1998, 1999, 2000, 2001, 2002, 2003, 2005
5 Free Software Foundation, Inc.
7 This file is part of GDB.
9 This program is free software; you can redistribute it and/or modify
10 it under the terms of the GNU General Public License as published by
11 the Free Software Foundation; either version 2 of the License, or
12 (at your option) any later version.
14 This program is distributed in the hope that it will be useful,
15 but WITHOUT ANY WARRANTY; without even the implied warranty of
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 GNU General Public License for more details.
19 You should have received a copy of the GNU General Public License
20 along with this program; if not, write to the Free Software
21 Foundation, Inc., 59 Temple Place - Suite 330,
22 Boston, MA 02111-1307, USA. */
27 /* GNU/Linux supports the i386 hardware debugging registers. */
28 #define I386_USE_GENERIC_WATCHPOINTS
30 #include "i386/nm-i386.h"
31 #include "config/nm-linux.h"
33 /* Support for the user area. */
35 /* Return the size of the user struct. */
36 extern int kernel_u_size (void);
37 #define KERNEL_U_SIZE kernel_u_size()
39 /* This is the amount to substract from u.u_ar0 to get the offset in
40 the core file of the register values. */
41 #define KERNEL_U_ADDR 0
43 extern CORE_ADDR
register_u_addr (CORE_ADDR blockend
, int regnum
);
44 #define REGISTER_U_ADDR(addr, blockend, regnum) \
45 (addr) = register_u_addr (blockend, regnum)
47 /* Provide access to the i386 hardware debugging registers. */
49 extern void i386_linux_dr_set_control (unsigned long control
);
50 #define I386_DR_LOW_SET_CONTROL(control) \
51 i386_linux_dr_set_control (control)
53 extern void i386_linux_dr_set_addr (int regnum
, CORE_ADDR addr
);
54 #define I386_DR_LOW_SET_ADDR(regnum, addr) \
55 i386_linux_dr_set_addr (regnum, addr)
57 extern void i386_linux_dr_reset_addr (int regnum
);
58 #define I386_DR_LOW_RESET_ADDR(regnum) \
59 i386_linux_dr_reset_addr (regnum)
61 extern unsigned long i386_linux_dr_get_status (void);
62 #define I386_DR_LOW_GET_STATUS() \
63 i386_linux_dr_get_status ()
66 /* Override copies of {fetch,store}_inferior_registers in `infptrace.c'. */
67 #define FETCH_INFERIOR_REGISTERS
69 /* Nevertheless, define CANNOT_{FETCH,STORE}_REGISTER, because we
70 might fall back on the code `infptrace.c' (well a copy of that code
71 in `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_fetch_register (regno)
76 #define CANNOT_STORE_REGISTER(regno) cannot_store_register (regno)
78 #ifdef HAVE_PTRACE_GETFPXREGS
79 /* Include register set support for the SSE registers. */
80 #define FILL_FPXREGSET
83 #endif /* nm-linux.h */