2002-02-14 Daniel Jacobowitz <drow@mvista.com>
[deliverable/binutils-gdb.git] / gdb / gdbserver / linux-i386-low.c
1 /* GNU/Linux/i386 specific low level interface, for the remote server for GDB.
2 Copyright 1995, 1996, 1998, 1999, 2000, 2001, 2002
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 #include "server.h"
23
24 #ifdef HAVE_SYS_REG_H
25 #include <sys/reg.h>
26 #endif
27
28 /* This module only supports access to the general purpose registers.
29 Adjust the relevant constants accordingly.
30
31 FIXME: kettenis/2001-03-28: We should really use PTRACE_GETREGS to
32 get at the registers. Better yet, we should try to share code with
33 i386-linux-nat.c. */
34
35 int num_regs = 16;
36
37 /* This stuff comes from i386-linux-nat.c. */
38
39 /* Mapping between the general-purpose registers in `struct user'
40 format and GDB's register array layout. */
41 int regmap[] =
42 {
43 EAX * 4, ECX * 4, EDX * 4, EBX * 4,
44 UESP * 4, EBP * 4, ESI * 4, EDI * 4,
45 EIP * 4, EFL * 4, CS * 4, SS * 4,
46 DS * 4, ES * 4, FS * 4, GS * 4
47 };
48
49 int
50 cannot_store_register (int regno)
51 {
52 return (regno >= num_regs);
53 }
54
55 int
56 cannot_fetch_register (int regno)
57 {
58 return (regno >= num_regs);
59 }
This page took 0.033395 seconds and 5 git commands to generate.